How to configure jenkins http to https?

Member

by addison , in category: Third Party Scripts , a month ago

How to configure jenkins http to https?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by aubrey , a month ago

@addison 

To configure Jenkins to use HTTPS instead of HTTP, you will need to follow these steps:

  1. Generate a SSL certificate and private key: You can either obtain a certificate from a trusted certificate authority (CA) or generate a self-signed certificate using tools like OpenSSL.
  2. Install the SSL certificate: Upload the SSL certificate and private key to a directory accessible by Jenkins.
  3. Configure Jenkins to use the SSL certificate: In the Jenkins configuration file (usually located at /etc/default/jenkins or /etc/sysconfig/jenkins), add the following lines: JENKINS_HTTPS_KEYSTORE=/path/to/keystore.jks JENKINS_HTTPS_KEYSTORE_PASSWORD=your_keystore_password JENKINS_HTTPS_KEYSTORE_KEYPASSWORD=your_key_password
  4. Update Jenkins HTTP listener: In the Jenkins configuration file, modify the HTTP listener configuration to redirect HTTP requests to HTTPS. Add the following line: JENKINS_ARGS="--httpPort=-1 --httpsPort=443"
  5. Restart Jenkins: Restart the Jenkins service to apply the changes.
  6. Access Jenkins using HTTPS: Jenkins should now be accessible over HTTPS at https://your_jenkins_url. Make sure to update any bookmarks or scripts that reference the old HTTP URL.


By following these steps, you can configure Jenkins to use HTTPS for secure communication.