# How to bypass ssl error connecting to sonar enterprise instance?

**URL:** <https://community.sonarsource.com/t/how-to-bypass-ssl-error-connecting-to-sonar-enterprise-instance/84103>\
**Category:** SonarQube Server / Community Build\
**Tags:** ssl, scanner\
**Created:** [February 15, 2023, 6:18pm UTC](https://community.sonarsource.com/t/how-to-bypass-ssl-error-connecting-to-sonar-enterprise-instance/84103 "2023-02-15T18:18:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abdul\_Mohammed](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/abdul_mohammed/32/28542_2.png) [@Abdul\_Mohammed](https://community.sonarsource.com/u/Abdul_Mohammed)\
**Post date:** [February 15, 2023, 6:18pm UTC](https://community.sonarsource.com/t/how-to-bypass-ssl-error-connecting-to-sonar-enterprise-instance/84103/1 "2023-02-15T18:18:51Z")

</div>

I can connect to scanner on http but on https, i get error on jenkins scanner pod  
is there a sonarscanner flag to pass to avoid this failure?  
-Dsonar.skip\_ssl=true?

```auto
17:43:59.037 INFO: ------------------------------------------------------------------------
17:43:59.037 INFO: EXECUTION FAILURE
17:43:59.037 INFO: ------------------------------------------------------------------------
17:43:59.037 INFO: Total time: 0.966s
17:43:59.048 INFO: Final Memory: 4M/68M
17:43:59.048 INFO: ------------------------------------------------------------------------
17:43:59.048 ERROR: Error during SonarScanner execution
org.sonarsource.scanner.api.internal.ScannerException: Unable to execute SonarScanner analysis
	at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.lambda$createLauncher$0(IsolatedLauncherFactory.java:85)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:74)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.createLauncher(IsolatedLauncherFactory.java:70)
	at org.sonarsource.scanner.api.EmbeddedScanner.doStart(EmbeddedScanner.java:185)
	at org.sonarsource.scanner.api.EmbeddedScanner.start(EmbeddedScanner.java:123)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:73)
	at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.IllegalStateException: Fail to get bootstrap index from server
	at org.sonarsource.scanner.api.internal.BootstrapIndexDownloader.getIndex(BootstrapIndexDownloader.java:42)
	at org.sonarsource.scanner.api.internal.JarDownloader.getScannerEngineFiles(JarDownloader.java:58)
	at org.sonarsource.scanner.api.internal.JarDownloader.download(JarDownloader.java:53)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherFactory.lambda$createLauncher$0(IsolatedLauncherFactory.java:76)
	... 7 more
Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source)
	at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
	at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
	at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
	at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(Unknown Source)
	at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(Unknown Source)
	at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(Unknown Source)
	at java.base/sun.security.ssl.SSLHandshake.consume(Unknown Source)
	at java.base/sun.security.ssl.HandshakeContext.dispatch(Unknown Source)
	at java.base/sun.security.ssl.HandshakeContext.dispatch(Unknown Source)
	at java.base/sun.security.ssl.TransportContext.dispatch(Unknown Source)
	at java.base/sun.security.ssl.SSLTransport.decode(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketImpl.decode(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.RealConnection.connectTls(RealConnection.java:336)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.RealConnection.establishProtocol(RealConnection.java:300)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.RealConnection.connect(RealConnection.java:185)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.java:224)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.java:108)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.ExchangeFinder.find(ExchangeFinder.java:88)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.Transmitter.newExchange(Transmitter.java:169)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:41)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.RealCall.getResponseWithInterceptorChain(RealCall.java:221)
	at org.sonarsource.scanner.api.internal.shaded.okhttp.RealCall.execute(RealCall.java:81)
	at org.sonarsource.scanner.api.internal.ServerConnection.callUrl(ServerConnection.java:115)
	at org.sonarsource.scanner.api.internal.ServerConnection.downloadString(ServerConnection.java:99)
	at org.sonarsource.scanner.api.internal.BootstrapIndexDownloader.getIndex(BootstrapIndexDownloader.java:39)
	... 10 more
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at java.base/sun.security.validator.PKIXValidator.doBuild(Unknown Source)
	at java.base/sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
	at java.base/sun.security.validator.Validator.validate(Unknown Source)
	at java.base/sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)
	at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
	at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
	... 45 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source)
	at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
	at java.base/java.security.cert.CertPathBuilder.build(Unknown Source)
	... 51 more

```

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [February 17, 2023, 10:14am UTC](https://community.sonarsource.com/t/how-to-bypass-ssl-error-connecting-to-sonar-enterprise-instance/84103/2 "2023-02-17T10:14:05Z")

</div>

Hey there.

If your SonarQube server is being served over HTTPS… it’s probably for a good reason. We don’t think users should be able to send their analyses unencrypted by choice.

What you should focus on is making sure that the Java installation running the scanner trusts the certificiates that are serving your SonarQube server over HTTPS. There are lots of [good resources](https://medium.com/@codebyamir/the-java-developers-guide-to-ssl-certificates-b78142b3a0fc) for getting Java to trust self-signed certificates.

---

<div class="post-metadata">

**Author:** ![Abdul\_Mohammed](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/abdul_mohammed/32/28542_2.png) [@Abdul\_Mohammed](https://community.sonarsource.com/u/Abdul_Mohammed)\
**Post date:** [February 17, 2023, 4:30pm UTC](https://community.sonarsource.com/t/how-to-bypass-ssl-error-connecting-to-sonar-enterprise-instance/84103/3 "2023-02-17T16:30:34Z")

</div>

My enterprise sonar instance has public cert from public ca. it is not private. so what are steps to configure this such that scanner does not fail.?

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [February 18, 2023, 9:15am UTC](https://community.sonarsource.com/t/how-to-bypass-ssl-error-connecting-to-sonar-enterprise-instance/84103/4 "2023-02-18T09:15:00Z")

</div>

What version of SonarQube are you. using, and what version of Java runs your scanner (the info should be at the beginning of your scanner logs)

---

<div class="post-metadata">

**Author:** ![jeme](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jeme/32/6827_2.png) [@jeme](https://community.sonarsource.com/u/jeme)\
**Post date:** [November 13, 2023, 9:24am UTC](https://community.sonarsource.com/t/how-to-bypass-ssl-error-connecting-to-sonar-enterprise-instance/84103/5 "2023-11-13T09:24:13Z")

</div>

I feel like there is a lack of guidance for this when using:

> **[SonarScanner for .NET](https://docs.sonarsource.com/sonarqube/9.8/analyzing-source-code/scanners/sonarscanner-for-dotnet/#net-core-and-net-core-global-tool-invocation)**
>
> The SonarScanner for .NET is the recommended way to launch an analysis for projects built using MSBuild or dotnet.
