Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,456,475
Community Members
 
Community Events
176
Community Groups

Jenkins (Docker Image) connecting to BitBucket Server

Hi at all:-)

I have jenkins v2.60.3 running as container installed within a docker image.

Our Company has a Bitbucket-Server v5.16.0 installed (https://bitbucket....:8555) where i can access using git commands on terminal running within the jenkins container. This work without problems.

But when i configure the Bitbucket Server Integration Plugin within the jenkins settings (before i did create a bitbucket personal admin access token and be sure i give the correct credentials i use to login to bitbucket and the URL includes the Port) and press the test connection button i get an error:

"Connection failure, please try again"

The jenkins logs shows:

"

com.atlassian.bitbucket.jenkins.internal.http.HttpRequestExecutorImpl

Bitbucket - io exception
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
...
"

I guess this means a certificate problem....what can i do to solve this?

I have no certificate.

Login to bitbucket using git commands does work with config "git config --global http.sslVerify "false"".

Is there a similiar possibility available within "Bitbucket Server Integration"-PlugIn?

Many thanks in adavance for help.

2 answers

We ran into the same issue building our new Jenkins server. The issue is that the Bitbucket server has a certificate, which means its traffic is encrypted (the https: in its URL). But by default your Linux server running Jenkins doesn't have the certificate authority's cert in its cacert.crt file to unencrypt it.

So I fixed it by obtaining the ca certificate files (.crt), transferring them to my home folder on the Linux server with WinSCP, then used the keytool to import them to the server's cacert file.  Finding the correct cacert file can take a little doing. Mine was in /etc/ssl/certs/java on Ubuntu with OpenJDK.  Then I rebooted the server.  The Jenkins to BitBucket test button now worked.

0 votes
Dave Chevell Atlassian Team May 25, 2020

Hey @Claudio Roßner ,

 

 You need to import Bitbucket's SSL certificate into the trust store of the JVM running Jenkins. It doesn't relate to which plugin you're using, it's Java itself seeing an invalid (self-signed, I assume) SSL certificate and rejecting it.

https://confluence.atlassian.com/kb/unable-to-connect-to-ssl-services-due-to-pkix-path-building-failed-error-779355358.html describes how to deal with this between Atlassian applications. For Jenkins, if you're running in Docker you should be able to follow similar steps.

Cheers

Dave

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events