title: Sonatype OSS Index Analyzer Error requesting component reports javax.net.ssl.SSLHandshakeException:
body: <p>I am using dependency-check-cli version 6.1.0 in Jenkins, while scanning for jar files it is giving me below error.</p>
  <pre><code>[DependencyCheck] [WARN] An error occurred while analyzing '/JenkinsHome/.jenkins/workspace/Demo/cryptix32.jar' (Sonatype OSS Index Analyzer).
  [DependencyCheck] [INFO] Finished Sonatype OSS Index Analyzer (1 seconds)
  [DependencyCheck] [INFO] Finished Vulnerability Suppression Analyzer (0 seconds)
  [DependencyCheck] [INFO] Finished Dependency Bundling Analyzer (0 seconds)
  [DependencyCheck] [INFO] Analysis Complete (8 seconds)
  [DependencyCheck] [INFO] Writing report to: /JenkinsHome/.jenkins/workspace/Demo/./dependency-check-report.html
  [DependencyCheck] [ERROR] Failed to request component-reports
  Build step 'Invoke Dependency-Check' changed build result to FAILURE
  </code></pre>
  <p>When I check the log report then I get the below error:</p>
  <pre><code>DEBUG - Connecting to: https://ossindex.sonatype.org/api/v3/component-report
  2021-06-04 17:39:51,398 org.owasp.dependencycheck.analyzer.OssIndexAnalyzer:147
  DEBUG - Error requesting component reports
  javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
      at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1949)
      at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302)
      at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296)
      at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1509)
      at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)
      at sun.security.ssl.Handshaker.processLoop(Handshaker.java:979)
      at sun.security.ssl.Handshaker.process_record(Handshaker.java:914)
      at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1062)
      at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
      at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
      at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
      at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
      at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
      at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1283)
      at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1258)
      at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)
      at org.sonatype.ossindex.service.client.transport.HttpUrlConnectionTransport.post(HttpUrlConnectionTransport.java:90)
      at org.sonatype.ossindex.service.client.internal.OssindexClientImpl.doRequestComponentReports(OssindexClientImpl.java:204)
      at org.sonatype.ossindex.service.client.internal.OssindexClientImpl.requestComponentReports(OssindexClientImpl.java:170)
      at org.owasp.dependencycheck.analyzer.OssIndexAnalyzer.requestReports(OssIndexAnalyzer.java:198)
      at org.owasp.dependencycheck.analyzer.OssIndexAnalyzer.analyzeDependency(OssIndexAnalyzer.java:138)
      at org.owasp.dependencycheck.analyzer.AbstractAnalyzer.analyze(AbstractAnalyzer.java:131)
      at org.owasp.dependencycheck.AnalysisTask.call(AnalysisTask.java:88)
      at org.owasp.dependencycheck.AnalysisTask.call(AnalysisTask.java:37)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
  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 sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:387)
      at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292)
      at sun.security.validator.Validator.validate(Validator.java:260)
      at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324)
      at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:229)
      at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)
      at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1491)
      ... 24 common frames omitted
  Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
      at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)
      at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)
      at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:382)
      ... 30 common frames omitted
  2021-06-04 17:39:51,399 org.owasp.dependencycheck.AnalysisTask:90
  WARN  - An error occurred while analyzing '/JenkinsHome/.jenkins/workspace/Demo/cryptix32.jar' (Sonatype OSS Index Analyzer).
  </code></pre>
  <p>I have even tried by importing the ssl certificate of <a href="https://ossindex.sonatype.org" rel="nofollow noreferrer">https://ossindex.sonatype.org</a> to /usr/java/jdk1.8.0_101/jre/lib/security/cacerts , but still facing same issue.</p>
  <p>Please guide me on how to fix this issue.</p>