I have successfully setup SSL in my local Tomcat at port 8443 with a certificate I generated locally for dev purposes. It is working fine.
In my /etc/hosts
file I have entries:
127.0.0.1 mydev.example mydevsecure.example
I can access my app by typing in:
https://mydevsecure.example:8443/myApp/myPage.jsp
[https]
OR
http://mydev.example/myApp/myPage.jsp
[http]
What I want is to be able to type: https://mydevsecure.example/myApp/myPage.jsp
I want to lose typing the port number 8443 in my browser.
I can't specify port number in /etc/hosts file that I am aware of.
What other solutions are there?
I solved this by the following approach:
Run the OpenSSL command to generate your private key and public certificate. Answer the questions and set a password as prompted.
openssl req -newkey rsa:2048 -nodes -keyout mykey.pem -x509 -days 365 -out mycert.pem
sudo yum install httpd
<VirtualHost _default_:443>
SSLEngine On
SSLCertificateFile /<path_to_ssl_certificate>/mycert.pem
SSLCertificateKeyFile /<path_to_ssl_key>/mykey.pem
ServerName https:// mydev.example
ServerAlias https:// mydev.example
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
</VirtualHost>
127.0.0.1 mydev.example
I can now access my application through secure URL: