开发者

Configuring Tomcat to Use SSL

开发者 https://www.devze.com 2023-04-06 09:31 出处:网络
My first question - isn\'t it possible to use https without using a Digital Certificate? My second question - I\'m securing few pages within my web application. So added the following

My first question - isn't it possible to use https without using a Digital Certificate? My second question - I'm securing few pages within my web application. So added the following

<security-constraint>
    <web-resource-collection>
        ......
    </web-resource-collection>
    <auth-constraint>
        ......
    </auth-constraint>
    <user-data-constraint>
        <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
</security-constraint>

I tried running the app and the pages for which ssl is enabled doesn't load. So I went ahead with creating certificate. Added the following in server.xml?

<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
       maxThreads="150" 
       scheme="https" 
       secure="true" 
       keystoreFile="C:\Program Files\apache-tomcat-7.0.11-windows-x86\apache-tomcat-7.0.11\.keystore" 
       keystorePass="johneipe"
       clientAuth="optional" 
       sslProtocol="TLS" 开发者_高级运维/>

Still I'm unable to access those pages nor https://localhost:8443.


Change your protocol to protocol="org.apache.coyote.http11.Http11Protocol"

This will solve the issue.


What format of keystore are you using? I believe the default in the Tomcat config is a JKS, but if you're using a PKCS#12 (.p12 or .pfx extension), you'll need to specify that.
Note the keystoreType="PKCS12".

<Connector port="1443"
           maxThreads="200"
           enableLookups="false" disableUploadTimeout="true"
           acceptCount="100" debug="0" scheme="https" secure="true"
           clientAuth="false" sslProtocol="TLS" SSLEnabled="true"
           keystoreFile="/opt/companyName/tomcat.keystore"
           keystoreType="PKCS12"
           keystorePass="password"
           ciphers="SSL_RSA_WITH_RC4_128_MD5,SSL_RSA_WITH_RC4_128_SHA,TLS_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_RSA_WITH_AES_128_CBC_SHA,TLS_DHE_DSS_WITH_AES_128_CBC_SHA,SSL_RSA_WITH_3DES_EDE_CBC_SHA,SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA,SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_DHE_RSA_WITH_AES_256_CBC_SHA,TLS_DHE_DSS_WITH_AES_256_CBC_SHA"
           URIEncoding="UTF-8"
       />
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号