Reputation: 41
I have tried deploying a war file to a remote machine through Jenkins Deploy to container plugin and it was successful. The tomcat URL was http://hostname:8080/. Later we have enabled SSL on the tomcat server. Now, the tomcat URL is https://hostname:8443. Pushing a war file to this SSL enabled tomcat server, is now failing with the below exception. There is no option available to mention about the SSL certificate on the JENKINS deploy to container plugin.
Caused by: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative names present
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)
Upvotes: 3
Views: 1936
Reputation: 41
I first moved my cacerts file to be sure that Jenkins actually tries to reach that file. After I could approve that Jenkins uses this file, I used Portecle to view all my Certificates in my cacerts, then imported the missing ones:
Since I still got the same error I realized I forgot to import the certificates of the server itself. I found my certificate in the jenkins.xml (my tomcat and Jenkins run on the same server) and put it in my cacerts and my other .jks file.
After saving and restarting all services it finally worked for me.
Upvotes: 1