I used the instruction at https://confluence.atlassian.com/bitbucketserver/securing-bitbucket-server-with-tomcat-using-ssl-776640127.html?_ga=2.56331501.730743067.1554138967-423285032.1546880165#SecuringBitbucketServerwithTomcatusingSSL-selfsignedcert to set up SSL for my bitbucket server installation. I am using a certificate from a CA so I used that section of the instructions.
- I generated the self signed certificate. This produced a .keystore file
- Then used the result of step #1 to generate CSR.
- I used the CSR to request a certificate which worked.
- When I tried to install the certificate using;
- keytool -import -alias tomcat -file gtswtbitsyslnxvm1_domain_com.crt -keystore /var/atlassian/application-data/bitbucket/.keystore
- Enter keystore password: - here I entered the password and got;
- keytool error: java.lang.Exception: Public keys in reply and keystore don't match
- I researched the issue and found a solution that if you changed the alias the key would import. So I did ;
- keytool -import -alias bitbucket -file gtswtbitsyslnxvm1_domain_com.crt -keystore /var/atlassian/application-data/bitbucket/.keystore
- The result was;
- Trust this certificate? [no]: yes ( entered yes to the question) and I got message “Certificate was added to keystore”.
- I then configured my bitbucket properties file see the keystore and use the new 8443 port. All this was ok. However, when I restarted the tool tried to connect using http it says the certificate is not trusted because it is self signed. I cannot use the self signed cert. What am I doing incorrectly in the process?