Jenkins log in to admin changing the port to Https

I was able to get Jenkins UI to use SSL and I have it currently going to HTTPS and port 8443, however when you go to click on the log in in the upper right corner of the UI to get into the admin of Jenkins it defaults the connection back to port 8080. My question is since we want to use port 8443 how do we stop this part (the log in to admin) from using the port 8080 and use 8443 as we use to get access to the UI. Is there some way to tell the system the port it needs to use for this connection thru log in? What I see is when I look at the link when you right click the log in icon is this :

https://mycompany-jenkins.com:8443/securityRealm/commenceLogin?from=%2F

but it takes me to another screen that says:

The information you’re about to submit is not secure

Because this form is being submitted using a connection that’s not secure, your information will be visible to others.
and then says continue or back if you right click the continue this is the link now:
http://mycompany-jenkins:8080/securityRealm/finishLogin
Why did it switch to 8080 from 8443? How do we have it connect using 8443? Do we need another certificate for the log in part as well?

Do you have configured the right url in Jenkins itself
jenkins → manage ->configure → Jenkins URL

If I switch it in the configuration, the system locks up and doesn’t go anywhere, so if I use the url https://mycompanyname-jenkins.com:8443 I can get into the Jenkins UI. But If I use that same URL in the configuration as you state, it errors out and I can’t get to the admin side. Then i am locked out of the system admin wise as the url in the config screen won’t go into the security realm of Jenkins? but using port 8080 to log into the UI and then clicking on Log in seems to take you to the same port 8080 to get into the security side, so I guess I need to know how to configure the security to use port 8443 not 8080?

How did you setup https for Jenkins? Do you have a reverse proxy in front or do you enable it via the start parameters (see Initial Settings)
Which security realm are you using?

1 Like