2012-05-11 7 views
6

tomcatでsslをサポートするには...私はKeystoreファイルを作成します。自己署名証明書が含まれている.....とTomcat 7.0の後、オープンserver.xmlファイルとserver.xmlをtomcat 7.0でsslをサポートするようにtomcatを設定する

`  <!-- 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" /> --> ` 

にこのコードを見つけて、コネクタからコメントを削除して置くこといるkeystoreFileエントリとKeystorePassこれを、次のようなコメントを外し、コネクタコードでエントリ.........

` <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のは、私は、この問題を整理するのに役立ちます。あなたはJSSEコネクター(BIOとNIO)のSSL構成で4月/ネイティブコネクタを使用している事前

+1

SOのトピックはありません。 [sf] –

答えて

14

でありがとう。最も単純な修正は、server.xml内のAPRライフサイクルリスナーをコメント化することです。

+1

に属している場合Apache Tomcat 7で 'keystorePass'の代わりに(または' keyPass'を)使用する必要があるかもしれません。 – Bruno

9

あなたは

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

protocol="HTTP/1.1" 

からを変更する必要がありますが、ここでは良い記事だ http://java.dzone.com/articles/setting-ssl-tomcat-5-minutes

mkyongの記事は時代遅れであると私は上記の提案された変更を欠いています。

関連する問題