Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue in tomcat 7.0 to configure tomcat to support ssl

Tags:

ssl

tomcat

To support ssl in tomcat....I make a Keystore file. that contain self-signed certificate.....and then open server.xml file of tomcat 7.0 and locate this code in server.xml

`     <!-- Define a SSL HTTP/1.1 Connector on port 8443
     This connector uses the JSSE configuration, when using APR, the
     connector should be using the OpenSSL style configuration
     described in the APR documentation -->

     <!-- <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
           maxThreads="150" scheme="https" secure="true"
           clientAuth="false" sslProtocol="TLS" /> -->    ` 

and remove comment from connector and put KeystoreFile entry and KeystorePass entry in uncommented connector code like following this.........

`    <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
      maxThreads="150" scheme="https" secure="true"
      clientAuth="false" sslProtocol="TLS" **keystoreFile**="d:\cpademo.keystore"
     **keystorePass**="cpademo"/>      `

The above code works in tomcat 6.0...and allow https connection with tomcat but i get the error in tomcat 7.0 log file which indicate that it does not suppoert connection to https 8443 connection. Error in log file is following as.....

ERROR:

SEVERE: Failed to initialize end point associated with ProtocolHandler ["http-ap
r-8443"]
java.lang.Exception: Connector attribute SSLCertificateFile must be defined when
using SSL with APR
    at org.apache.tomcat.util.net.AprEndpoint.bind(AprEndpoint.java:484)
    at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:554)

Pls help me sort out this problem. Thanx in advance

like image 505
user1206218 Avatar asked May 11 '12 05:05

user1206218


1 Answers

You are using the APR/native connector with the SSL configuration for the JSSE connectors (BIO and NIO). The simplest fix will be to comment out the APR lifecycle listener in server.xml.

like image 124
Mark Thomas Avatar answered Nov 15 '22 09:11

Mark Thomas