%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA -keystore E:\keystore
保存为一个bat文件,运行填入相关信息。E:\keystore就是证书文件。
然后在server.xml中加入:
<Connector className="org.apache.catalina.connector.http.HttpConnector"
port="443" minProcessors="5" maxProcessors="75"
enableLookups="true"
acceptCount="10" debug="0" scheme="https" secure="true">
<Factory className="org.apache.catalina.net.SSLServerSocketFactory"
clientAuth="false" protocol="TLS"
keystoreFile="E:\keystore" keystorePass="changeit"
/>
</Connector>http和https必须使用两个不同的端口,设置一个目录是否要证书,只需要在访问时把http改为https(前提是http和https使用的是默认的端口,80和443,不然改为https时需要指点端口号)
保存为一个bat文件,运行填入相关信息。E:\keystore就是证书文件。
然后在server.xml中加入:
<Connector className="org.apache.catalina.connector.http.HttpConnector"
port="443" minProcessors="5" maxProcessors="75"
enableLookups="true"
acceptCount="10" debug="0" scheme="https" secure="true">
<Factory className="org.apache.catalina.net.SSLServerSocketFactory"
clientAuth="false" protocol="TLS"
keystoreFile="E:\keystore" keystorePass="changeit"
/>
</Connector>http和https必须使用两个不同的端口,设置一个目录是否要证书,只需要在访问时把http改为https(前提是http和https使用的是默认的端口,80和443,不然改为https时需要指点端口号)
解决方案 »
- wsdl转成java 客户端出错
- oracle账号检查SQL语句
- SSH插入数据时因为有相同数据而抛出异常!
- hibernate看什么书比较好
- 如何解决The transaction is no longer active - status: 'Committed'?
- 多对一映射@ManyToOne添加数据问题
- java怎么生成html图表,柱图折线图和柄图
- XML comment里面包含CDATA字符怎么处理?
- 开发Struts遇到问题!在线等待,解决了立即给分
- 无法在网页中显示Applet程序
- 大家推荐几本学习J2EE的好书。
- 公司要做一个jsp的项目,要使用struts,请大家推荐好书!
在jsp文档中只需要判断是否获取到了证书就可以了!