0

My question is: why won't tomcat respond when I turn on SSL?

I've attempted to migrate a working tomcat7 web application from an Ubuntu 12.10 x64 Server to a fresh Ubuntu 14.04 x64 server. Every attempt has been made to keep the configuration the same between the two machines.

Everything was working great on port 80. When I edit the server.xml file to enable the SSL Connector, then I stop getting responses from the server. I can open a connection but it just hangs there. For example I can telnet to port 443, and I can send a "GET /" command, but there is no response. The server is not attempting an SSL handshake.

There are no errors in catalina.out, in fact I can see the success message for the SSL protocol handler:

Feb 13, 2015 10:28:49 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-443"]

I've verified that the keystore file is valid by listing the contents with the keytool command. The keystore is just a copy of the one from the old server so I don't expect any problems with the certificates or anything. The file permissions on the keystore should not be a problem, I've even tried chmod 777 on it and there is no change in behavior.

Here is my Connector for server.xml. Again server.xml is an exact copy from the previous Ubuntu 12 server so I think the issue lies somewhere else.

<Connector port="443" SSLEnabled="true" protocol="HTTP/1.1"
           maxThreads="150" scheme="https" secure="true"
           clientAuth="false" sslProtocol="TLS"
           keystoreFile="/var/lib/mywebapp/mywebapp.keystore"
           keystorePass="xxxxxxxx"/> 

I've tried to explicitely set the protocol here and i've tried all three values available:

org.apache.coyote.http11.Http11Protocol - same result

org.apache.coyote.http11.Http11NioProtocol - same result

org.apache.coyote.http11.Http11AprProtocol - exception that APR/native library is not available

tomcat version info:

Using CATALINA_BASE:   /usr/share/tomcat7
Using CATALINA_HOME:   /usr/share/tomcat7
Using CATALINA_TMPDIR: /usr/share/tomcat7/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar
Server version: Apache Tomcat/7.0.52 (Ubuntu)
Server built:   Jul 24 2014 08:38:51
Server number:  7.0.52.0
OS Name:        Linux
OS Version:     3.13.0-37-generic
Architecture:   amd64
JVM Version:    1.7.0_71-b14
JVM Vendor:     Oracle Corporation
0

1 Answer 1

0

The problem is Tomcat waiting for entropy. To solve this, add the following param to JVM:

-Djava.security.egd=file:/dev/./urandom

Not the answer you're looking for? Browse other questions tagged .