Chaitanya
Chaitanya

Reputation: 2444

play framework 2.3.7 - SSL confirguration

I am trying to setup SSL connection for my Play application. Here is the process I followed:

keytool -genkeypair -v -alias example.com -keystore example.com.jks -keyalg RSA -keysize 2048 -validity 385

keytool -certreq -v -alias example.com -keypass password -storepass password -keystore example.com.jks -file example.com.csr

Submitted the CSR to godaddy and downloaded the certificates.

keytool -import -v -alias root -file gdroot-g2.crt -keystore example.com.jks -storetype JKS

keytool -import -v -alias intermed -file gdig2.crt -keystore example.com.jks -storetype JKS

keytool -import -v -alias example.com -file 46826eerd8c69.crt -keystore example.com.jks -storetype JKS

After this added 127.0.0.1 www.example.com to my /etc/hosts and started the play server as below.

./activator -Dhttps.port=9443 -Dhttps.keyStore=/tmp/ssl/example.com.jks -Dhttps.keyStorePassword=password run

Now when I try to access the url via browser https://www.example.com:9443, I see the following message. No errors on the server.

Unable to make a secure connection to the server. This may be a problem with the server, or it may be requiring a client authentication certificate that you don't have. Error code: ERR_SSL_PROTOCOL_ERROR

I have no clue of what's happening. I followed the entire process twice, but still no luck.

Any help is appreciated.

Upvotes: 0

Views: 350

Answers (1)

Chaitanya
Chaitanya

Reputation: 2444

The issue is because of accessing the application by adding 127.0.0.1 www.example.com to /etc/hosts. I followed the same procedure on a remove server and added it's ip to /etc/hosts, then things started worked fine.

Seems like for some reason the certificate is not getting accepted by loopback ip in /etc/hosts.

Upvotes: 0

Related Questions