Problem in tomcat 7.0 to configure tomcat for ssl support

To support ssl in tomcat .... I am making a Keystore file. which contain a self-signed certificate ..... and then open the server.xml file tomcat 7.0 and find this code in the server.xml file

` <!-- 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 the comment from the connector and add the KeystoreFile and KeystorePass entry to the code without commenting, for example, 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) 

Help me deal with this problem. Thanks in advance

+6
source share
2 answers

Uses an APR / native connector with SSL configuration for JSSE connectors (BIO and NIO). The simplest solution would be to compile the APR lifecycle listener in server.xml.

+14
source

You must change the protocol from

 protocol="HTTP/1.1" 

to

 protocol="org.apache.coyote.http11.Http11NioProtocol" 

Here is a good article http://java.dzone.com/articles/setting-ssl-tomcat-5-minutes

mkyong article is deprecated and does not have the changes that I suggested above.

+9
source

Source: https://habr.com/ru/post/915470/


All Articles