tomcat7 服务器配置HTTPS安全协议
2015-07-28 11:00
591 查看
cmd keytool -v -genkey -alias tomcat -keyalg RSA -validity 20000 -keystore d:/tomcat.keystore
-validity 表示证书多少天
-keystore 表示证书存放的位置
找到tomcat7/conf/server.xml
keystoreFile 表示证书的位置
找到tomcat7/conf/web.xml
在</web-app>节点里面增加
在自己的项目web.xml里面
</web-app>节点里面增加
最后直接https://locahost 访问 配置成功
-validity 表示证书多少天
-keystore 表示证书存放的位置
找到tomcat7/conf/server.xml
<!--取消注释 tomcat/conf/server.xml ,并指定安全证书位置和密码--> <Connector port="443" protocol="org.apache.coyote.http11.Http11Protocol" SSLEnabled="true" enableLookups="false" acceptCount="100" disableUploadTimeout="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" keystoreFile="D:/apache-tomcat-7.0.59/conf/keystore/tomcat.keystore" keystorePass="123456"/>
</pre><pre class="html" name="code">
keystoreFile 表示证书的位置
找到tomcat7/conf/web.xml
在</web-app>节点里面增加
<!--禁用HTTP的不安全方法--> <security-constraint> <web-resource-collection> <url-pattern>/*</url-pattern> <http-method>PUT</http-method> <http-method>DELETE</http-method> <http-method>HEAD</http-method> <http-method>OPTIONS</http-method> <http-method>TRACE</http-method> </web-resource-collection> <auth-constraint></auth-constraint> </security-constraint>
在自己的项目web.xml里面
</web-app>节点里面增加
<!-- 所有http请求强转为HTTPS请求 --> <security-constraint> <!-- Authorization setting for SSL --> <web-resource-collection> <web-resource-name>OPENSSL</web-resource-name> <url-pattern>/*</url-pattern> </web-resource-collection> <user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint>
最后直接https://locahost 访问 配置成功
相关文章推荐
- 网络爬虫基本原理(一)
- 网络爬虫基本原理二
- 1149-PIGS(网络流建模,缩点)
- 自组织神经网络的实现
- Nmap新增脚本http-svn-enum和http-svn-info
- Linux网络编程select模型的实现
- ProtoBuf
- https 对接非对称密钥加密 MD5及数字签名相关
- TCP and UDP Small Servers
- 【iOS】MD5加密与网络数据安全
- 网络请求之GET、POST请求
- http错误码
- https://123.56.95.148/svn/Source/secretary
- 7月第3周网络安全报告:应用程序漏洞居首 涨27.7%
- JAVA网络编程-----TCP沟通
- Java网络编程基础
- 大黄蜂(HORNET):比Tor更快更安全的匿名网络
- Source Insight基本使用和快捷键 http://www.cnblogs.com/mengdd/p/3506526.html
- SCVMM 2012 R2运维管理十四之:VMM中网络概述
- SCVMM 2012 R2运维管理十四之:VMM中网络概述