I have a website (http://app4u.ml/, that resides in Ubuntu) with Tomcat installed on it. Via HTTP, everything works great.
I tried adding to the site HTTPS.
I downloaded a self-signed certificate from http://www.selfsignedcertificate.com/ and put the '.cert' and '.key' in the server in
/etc/ssl/localcerts and '.crt' file in
Then, I ran on Putty:
openssl req -new -x509 -sha256 -days 365 -nodes -out /etc/ssl/localcerts/app4u.ml.crt -keyout /etc/ssl/localcerts/app4u.ml.key chmod 600 /etc/ssl/localcerts/app4u.ml*
Then, I added to the 2 files in
/etc/apache2/sites-available the values of:
<VirtualHost *:443> SSLEngine On SSLCertificateFile /etc/ssl/localcerts/app4u.ml.cert SSLCertificateKeyFile /etc/ssl/localcerts/app4u.ml.key ServerAdmin firstname.lastname@example.org ServerName app4u.ml DocumentRoot /var/www/html/public_html/ ErrorLog /var/www/html/log/error.log CustomLog /var/www/html/log/access.log combined </VirtualHost>
sudo a2enmod ssl and then
service apache2 restart.
This made trying to get the site in HTTPS throw a warning in chrome. If I tried to continue, I saw an empty folder list (but it had values in it if I tried to go to it in plain HTTP). Also, trying to contact the Tomcat on the server throws
javax.net.ssl.SSLHandshakeException: Handshake failed
What have I done wrong? What is missing?
EDIT2: Further problems - Now my tomcat work for GET requests, but not POST. For POST requests I get
javax.net.ssl.SSLHandshakeException: Handshake failed. Why?