Enabling SSL in Jenkins is a bit tricky. To do this first you need to convert your keys to PKCS12
.
$ sudo openssl pkcs12 -inkey key.pem -in cert.pem -export -out keys.pkcs12
Then created a keystore (password for keystore should be same as password for key).
$ sudo keytool -importkeystore -srckeystore keys.pkcs12 -srcstoretype pkcs12 -destkeystore keystore
Then update the Jenkins config file. In Ubuntu it is located on /etc/default/jenkins
. Should be like this...
HTTPS_PORT=8443
KEYSTORE=/etc/letsencrypt/live/domain.com/keystore
PASSWORD=xxxxxxxx
JENKINS_ARGS="--webroot=/var/cache/$NAME/war --httpsPort=$HTTPS_PORT --httpsKeyStore=$KEYSTORE --httpsKeyStorePassword=$PASSWORD --httpPort=-1"
This was the simplest thing I'd found via google, so tried it. I already had a PKCS12 cert/keystore, so followed this and jenkins restarts, but still can't access via the browser (get an ERR_CONNECTION_REFUSED). Any ideas?