当前位置: > Linux服务器 > Tomcat >

解决tomcat配置ssl报Connector attribute SSLCertificateFile must be defined when using SSL with APR错误

时间:2016-06-04 19:11来源:linux.it.net.cn 作者:IT
今天同事要求帮忙配置tomcat ssl,直接把linux下tomcat配置ssl这篇文章发给他了,没想到他居然说启动tomcat的时候,报Connector attribute SSLCertificateFile must be defined when using SSL with APR的错误,马上跑过去看,原来他的tomcat版本是7.0的,我发给他的是tomcat6的,检查了key,检查了配置文件,因为他直接复制的我发他文章的配置,折腾了2-3个小时,终于把问题给解决了.


   系统:windows 7
   环境:tomcat7


1.先重新给他生成key
keytool -genkey -alias tomcat -keyalg RSA
01 Enter keystore password:  password
02 Re-enter new password: password
03 What is your first and last name?
04   [Unknown]:  Loiane Groner
05 What is the name of your organizational unit?
06   [Unknown]:  home
07 What is the name of your organization?
08   [Unknown]:  home
09 What is the name of your City or Locality?
10   [Unknown]:  Sao Paulo
11 What is the name of your State or Province?
12   [Unknown]:  SP
13 What is the two-letter country code for this unit?
14   [Unknown]:  BR
15 Is CN=Loiane Groner, OU=home, O=home, L=Sao Paulo, ST=SP, C=BR correct?
16   [no]:  y
17  
18 Enter key password for
19     (RETURN if same as keystore password):  password
20 Re-enter new password: password


2.tomcat配置ssl
打开server.xml文件里,他们原来是
1 <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"enableLookups="false"
2            acceptCount="100" disableUploadTimeout="true"
3            maxThreads="150" scheme="https" secure="true"
4            clientAuth="false" sslProtocol="TLS"
5            keystoreFile="Users\loiane/.keystore"
6            keystorePass="password" />

修改为:
 
1 <Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"SSLEnabled="true"
2            enableLookups="false"
3            acceptCount="100" disableUploadTimeout="true"
4            maxThreads="150" scheme="https" secure="true"
5            clientAuth="false" sslProtocol="TLS"
6            keystoreFile="Users\loiane/.keystore"
7            keystorePass="password" />


然后重启tomcat,没有报错,搞定闪人.


(责任编辑:IT)
------分隔线----------------------------
栏目列表
推荐内容