Skip to content
Advertisement

Turn off ssl certificate validation for JiraRestClient

I’m trying to connect to my Jira via the atlassian rest api java framework:

JavaScript

But this causes a errors:

javax.net.ssl.SSLHandshakeException: General SSLEngine problem

PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

I think this happens because I use a self-signed certificate for my Jira. Is there a way to turn of certificate validation for the JiraRestClientFactory at least for development purposes?

Advertisement

Answer

Thanks for the replies! The solution I ended up with is based on Karol Dowbeckis answer:

JavaScript

I had to add my own simple implementations of NoOpEventPublisher and RestClientApplicationProperties because the atlassian classes are private.

Additional information for this code sample

  • this example is using the jira rest client version 4.0.0
  • NoOpEventPublisher is just an implementation of com.atlassian.event.api.EventPublisher with empty method bodies.
  • RestClientApplicationProperties implements com.atlassian.sal.api.ApplicationProperties returning my jira url in getBaseUrl and “4.0.0” in getVersion
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement