您的位置:首页 > 理论基础 > 计算机网络

tomcat配置https方法

2017-10-11 17:27 295 查看


1、客户端

String url ="https://127.0.0.1:8443/Seal" + SealClient.SLASH +SealClient.BUSINESS_SEAL_SERVLET;

SealClient sealClient = new SealClient(url,"./testData/cert/client.pfx", "cfca1234","./testData/cert/client.jks", "cfca1234");

2、D:\apache-tomcat-7.0.69加入server.jks

3、修改D:\apache-tomcat-7.0.69\conf\server.xml

加入代码

<Connector port="8443"protocol="org.apache.coyote.http11.Http11Protocol"

               maxThreads="150"SSLEnabled="true" scheme="https" secure="true"

               clientAuth="false"sslProtocol="TLS"

                               keystoreFile="server.jks"keystorePass="cfca1234"

                               truststoreFile="server.jks"truststorePass="cfca1234"/>

 

遇到问题:javax.net.ssl.SSLHandshakeException:Received fatal alert: handshake_failure

JDK版本与tomcat不匹配

注意:JDK1.6配置tomcat 6  JDK1.7配置tomcat7才能访问成功

 

clientAuth="false"表示单项认证,clientAuth="true"表示双向认证。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: