当前位置: 代码迷 >> Web前端 >> 基于Tomcat 的SSL证件配置步骤
  详细解决方案

基于Tomcat 的SSL证件配置步骤

热度:323   发布时间:2012-10-17 10:25:47.0
基于Tomcat 的SSL证书配置步骤
步骤一:生成证书:
   (参见http://mazhihui.iteye.com/blog/1012912);

步骤二:配置Tomcat:
   找到%TOMCAT_HOME%/conf/server.xml,配置代码:
  
   <Connector SSLEnabled="true" 
			   clientAuth="false" 
			   keystoreFile="D:/SSL/server/tomcat.keystore" 
			   keystorePass="pdepde" 
			   maxThreads="150" 
			   port="8443" 
			   protocol="HTTP/1.1" 
			   scheme="https" 
			   secure="true" 
			   sslProtocol="TLS" 
			   truststoreFile="D:/SSL/server/tomcat.keystore" 
			   truststorePass="pdepde"/>    


步骤三:配置Web应用:
   找到Web应用下的WEB-INF/web.xml,在<welcome-file-list>之后添加配置代码:
     
  <security-constraint>
		<web-resource-collection>
			<web-resource-name>shouye</web-resource-name>
			<url-pattern>/demo.jsp</url-pattern>
		</web-resource-collection>
		<user-data-constraint>
			<transport-guarantee>CONFIDENTIAL</transport-guarantee>
		</user-data-constraint>
	</security-constraint>   

   (关于<security-constraint>

  相关解决方案