Jenkins fails to deploy due to self-signed certificate


walter van denput

We made a Java keystore and configured our Jenkins as follows:

<Connector
           protocol="org.apache.coyote.http11.Http11NioProtocol"
           port="8443" maxThreads="200"
           scheme="https" secure="true" SSLEnabled="true"
           keystoreFile="${user.home}/ourkeystore.keystore" keystorePass="ourpassword"
           clientAuth="false" sslProtocol="TLS"/>

But Jenkins shows the following:

org.codehaus.cargo.container.ContainerException: Failed to redeploy [C:\Program Files (x86)\Jenkins\workspace\Courseka - Backend\build\libs\campus.war]
    at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:193)
    at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:73)
    at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:116)
    at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:103)
    at hudson.FilePath.act(FilePath.java:996)
    at hudson.FilePath.act(FilePath.java:974)
    at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:103)
    at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:61)
    at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
    at hudson.model.Build$BuildExecution.post2(Build.java:186)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665)
    at hudson.model.Run.execute(Run.java:1753)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:405)
Caused by: 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(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
    at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
    at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
    at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)
    at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
    at sun.security.ssl.Handshaker.processLoop(Unknown Source)
    at sun.security.ssl.Handshaker.process_record(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(Unknown Source)
    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:534)
    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:686)
    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:699)
    at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:174)
    ... 16 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 sun.security.validator.PKIXValidator.doBuild(Unknown Source)
    at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
    at sun.security.validator.Validator.validate(Unknown Source)
    at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)
    at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
    at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
    ... 31 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source)
    at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
    at java.security.cert.CertPathBuilder.build(Unknown Source)
    ... 37 more
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(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
    at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
    at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
    at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)
    at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
    at sun.security.ssl.Handshaker.processLoop(Unknown Source)
    at sun.security.ssl.Handshaker.process_record(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(Unknown Source)
    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:534)
    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:686)
    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:699)
    at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:174)
    at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:73)
    at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:116)
    at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:103)
    at hudson.FilePath.act(FilePath.java:996)
    at hudson.FilePath.act(FilePath.java:974)
    at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:103)
    at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:61)
    at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
    at hudson.model.Build$BuildExecution.post2(Build.java:186)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665)
    at hudson.model.Run.execute(Run.java:1753)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:405)
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(Unknown Source)
    at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
    at sun.security.validator.Validator.validate(Unknown Source)
    at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)
    at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
    at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
    ... 31 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source)
    at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
    at java.security.cert.CertPathBuilder.build(Unknown Source)
    ... 37 more
Build step 'Deploy war/ear to a container' marked build as failure
Finished: FAILURE

After some googling, it appears to be because our certificate is invalid, since it's not a real certificate, but a self-signed one. Is there a way to get Jenkins to deploy?

lax1089

I strongly recommend using the " Skip Certificate Checking Plugin" when using self-signed certificates in Jenkins . In some cases (and it sounds like yours is one of them), this is the most logical path of least resistance.

According to the plugin description:

This is a plugin that makes the JVM bypass all HTTPS certificate checks. Handy if you deal with self-signed certificates. Please use with caution.

All you need to do is install the plugin. No configuration required.

Related


Jenkins fails to deploy due to self-signed certificate

walter van denput We made a Java keystore and configured our Jenkins as follows: <Connector protocol="org.apache.coyote.http11.Http11NioProtocol" port="8443" maxThreads="200" scheme="https" secure="true" SSLEnabled="true"

Jenkins fails to deploy due to self-signed certificate

walter van denput We made a Java keystore and configured our Jenkins as follows: <Connector protocol="org.apache.coyote.http11.Http11NioProtocol" port="8443" maxThreads="200" scheme="https" secure="true" SSLEnabled="true"

Jenkins fails to deploy due to self-signed certificate

walter van denput We made a Java keystore and configured our Jenkins as follows: <Connector protocol="org.apache.coyote.http11.Http11NioProtocol" port="8443" maxThreads="200" scheme="https" secure="true" SSLEnabled="true"

Jenkins fails to deploy due to self-signed certificate

walter van denput We made a Java keystore and configured our Jenkins as follows: <Connector protocol="org.apache.coyote.http11.Http11NioProtocol" port="8443" maxThreads="200" scheme="https" secure="true" SSLEnabled="true"

Firebase fails to deploy. Bad self-signed certificate

Joshua Santiago I've been following a tutorial on how to apply Dialoglflow to an app... https://developers.google.com/actions/dialogflow/first-app#deploy_the_fulfillment In the "Built-in Accessories" section, an error occurred. I have installed the latest node

Firebase fails to deploy. Bad self-signed certificate

Joshua Santiago I've been following a tutorial on how to apply Dialoglflow to an app... https://developers.google.com/actions/dialogflow/first-app#deploy_the_fulfillment In the "Built-in Accessories" section, an error occurred. I have installed the latest node

Jenkins git plugin self-signed certificate

Tobias I'm currently trying to get Jenkins to build a project hosted in a GitHub enterprise repository. We're using a self-signed certificate for the GitHub server, which is causing some issues. Most of the problems I was able to solve: git command line: Get t

Jenkins git plugin self-signed certificate

Tobias I'm currently trying to get Jenkins to build a project hosted in a GitHub enterprise repository. We're using a self-signed certificate for the GitHub server, which is causing some issues. Most of the problems I was able to solve: git command line: Get t

Jenkins git plugin self-signed certificate

Tobias I'm currently trying to get Jenkins to build a project hosted in a GitHub enterprise repository. We're using a self-signed certificate for the GitHub server, which is causing some issues. Most of the problems I was able to solve: git command line: Get t

Jenkins git plugin self-signed certificate

Tobias I'm currently trying to get Jenkins to build a project hosted in a GitHub enterprise repository. We're using a self-signed certificate for the GitHub server, which is causing some issues. Most of the problems I was able to solve: git command line: Get t

How do I deploy a self-signed certificate?

Robert_Junior I was asked to enable https for our ASP.net mvc3 application. So I created a self signed certificate using IIS7 and deployed the certificate in IIS7 but when using the https site in the webbrowser it says the certificate is not trusted After goog

How do I deploy a self-signed certificate?

Robert_Junior I was asked to enable https for our ASP.net mvc3 application. So I created a self signed certificate using IIS7 and deployed the certificate in IIS7 but when using the https site in the webbrowser it says the certificate is not trusted After goog

TLS connection via self-signed certificate fails

Integrator: The following reduced test case code works when run locally on my laptop using my own "developer" certificate to access internal services If I run on a remote machine with dynamically generated certificates (all handled by separate teams in the org

TLS connection via self-signed certificate fails

Integrator: The following reduced test case code works when run locally on my laptop using my own "developer" certificate to access internal services If I run on a remote machine with dynamically generated certificates (all handled by separate teams in the org

TLS connection via self-signed certificate fails

Integrator: The following reduced test case code works when run locally on my laptop using my own "developer" certificate to access internal services If I run on a remote machine with dynamically generated certificates (all handled by separate teams in the org

Apache fails to start after generating self-signed certificate

Grid Apache fails to start with an error... 1:08:52 a.m. [Apache] Error: Apache shutdown unexpectedly. 1:08:52 a.m. [Apache] This may be due to a blocked port, missing dependencies, 1:08:52 a.m. [Apache] improper privileges, a crash, or a shutdown by an

TLS connection via self-signed certificate fails

Integrator: The following reduced test case code works when run locally on my laptop using my own "developer" certificate to access internal services If I run on a remote machine with dynamically generated certificates (all handled by separate teams in the org

TLS connection via self-signed certificate fails

Integrator: The following reduced test case code works when run locally on my laptop using my own "developer" certificate to access internal services If I run on a remote machine with dynamically generated certificates (all handled by separate teams in the org

MacOS Jenkins: Locate JRE and import self-signed certificate

learning spirit Newbie here with macOS. We installed Jenkins on MacOS. I need to know which JREs and cacerts it uses, because I need to import the self-signed certificate of GitHub Enterprise Server for integration. I have an SSL error and am trying to follow