title: jenkins can't find path to the ssl certification
body: <p>I have added the certification to the C:\Program Files\Java\jre1.8.0_241\lib\security\certs file and also to the C:\Program Files (x86)\Jenkins\jre\lib\security\cacerts file but jenkins still throwing me this error :</p>
  
  <pre><code>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:1946)
      at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:316)
      at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:310)
      at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1640)
      at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:223)
      at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1037)
      at sun.security.ssl.Handshaker.process_record(Handshaker.java:965)
      at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1064)
      at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1367)
      at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1395)
      at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1379)
      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:1340)
      at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1315)
      at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:264)
      at com.occCheckNoData.insertReportAsTable.httpClient.sender(httpClient.java:54)
      at com.occCheckNoData.insertReportAsTable.insertReportAsTable.main(insertReportAsTable.java:42)
  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:450)
      at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:317)
      at sun.security.validator.Validator.validate(Validator.java:262)
      at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:330)
      at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:227)
      at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:132)
      at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1622)
      ... 14 more
  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:445)
      ... 20 more
  </code></pre>
  
  <p>on the command prompt it works but not on jenkins.
   then i tried to do like in this link :
  <a href="https://support.cloudbees.com/hc/en-us/articles/217078498-PKIX-path-building-failed-error-message" rel="nofollow noreferrer">https://support.cloudbees.com/hc/en-us/articles/217078498-PKIX-path-building-failed-error-message</a></p>
  
  <p>but these two commands are not recognized by the system :</p>
  
  <pre><code>-Djavax.net.ssl.trustStore=$JAVA_HOME/jre/lib/security/cacert
  -Djavax.net.ssl.trustStorePassword=changeit
  </code></pre>