Enable SSL (HTTPS) for Jenkins
This guide details the steps required to enable HTTPS on the Jenkins docker container. It follows Jenkins documentation: https://www.jenkins.io/doc/book/installing/initial-settings/#configuring-http
Prerequisites
Keystores
It is assumed you have SSL certificates provided.
identity.jks
is your identity store with the server certificatetrust.jks
is your trust store with any trusted certificates (eg. organization CA certs)
Setting Up HTTPS
Creating Keystores Directory
Create a new directory under the Myst server installation and copy your keystore there named identity.jks
and trust.jks
.
Adding Myst Certificate to trust.jks
Jenkins will publish application metadata to Myst. This is done during the build process. If untrusted, you will see errors during the build process when Jenkins publishes application metadata to Myst.
There are two options. Use one option only.
Reuse existing truststore or;
Create a new truststore
Option 1: Reuse existing Truststore
Copy the existing Jenkins Java
cacerts
Option 2: Create a New Truststore
Go to the keystores directory
Retreive the certificate from Myst. Change
localhost:443
to your mysthostname:port
.
Load the myst certificate into the truststore.
Updating docker-compose-base.yml
Make a backup of the
docker-compose-base.yml
Update
/opt/myst-studio/conf/ci/docker-compose-base.yml
.
A detailed explanation of the changes are in the Appendix.
Restart
Restarting will also restart Myst Studio, Artifactory, and Jenkins.
And you're finished!
Appendix
Explanation of YAML Changes
Ports
Expose the HTTPS port such as
- 8443:8443
Comment out
- 8081:8080
so HTTP is disabled
Options
Change
8443
to anything you'd like such as- 8443:443
To also allow HTTP uncomment
- 8081:8080
Volumes
Links the keystores directory created earlier to the Jenkins container.
Environment Variables
Environment variable used by Jenkins on startup.
Options
The
--httpPort=-1
disables HTTPChange to
--httpPort=8080
if you want to allow HTTP too.
Troubleshooting
Check the Jenkins docker logs on the Myst server: docker logs -f myststudio_ci
Issues
Raise a support ticket at https://mystsoftware.freshdesk.com .
Last updated