tomcat配置https访问系统
2013-10-11 11:33
761 查看
确认系统中装好了openssl,如果没有则安装!
通过https协议访问,需要安装证书!这里使用java去生成证书:cmd,命令行执行命令:
打开tomcat目录conf下的server.xml,8080端口的redirectPort指向443,或者8443,443为ssl协议默认的端口。
在tomcat下面conf的目录:web.xml最后添加下面配置。这样我们访问webapp下面的系统,都会转发成https了。
通过https协议访问,需要安装证书!这里使用java去生成证书:cmd,命令行执行命令:
keytool -v -genkey -alias tomcat -keyalg RSA -keystore /weblogic/apache-tomcat-6.0.32/conf/tomcat.keystore
keytool -v -genkey -alias tomcat -keyalg RSA -keystore D:\tomcat.keystore输入密码和确认密码,再输入相关信息。这里把证书生成到了。/weblogic/apache-tomcat-6.0.32/conf/tomcat.keystore目录下,如果是windows,则是D:\tomcat.keystore目录。
打开tomcat目录conf下的server.xml,8080端口的redirectPort指向443,或者8443,443为ssl协议默认的端口。
<Connector port="8080" protocol="HTTP/1.1" maxThreads="150" connectionTimeout="20000" redirectPort="443" /> <!-- Define a SSL HTTP/1.1 Connector on port 8443 This connector uses the JSSE configuration, when using APR, the connector should be using the OpenSSL style configuration described in the APR documentation --> <!--keystoreFile就是java生成的证书文件,我放在了tomcat的conf目录下,keystorePass就是生成证书时输入的密码--> <Connector port="443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" keystoreFile="conf/server.keystore" keystorePass="zyujiePass"/> <!-- Define an AJP 1.3 Connector on port 8009 --> <Connector port="8009" protocol="AJP/1.3" redirectPort="443" />上述配置完成了,输入https://127.0.0.1:443/可以访问了。不过443是https默认的端口,我们只用https://127.0.0.1/即可。
在tomcat下面conf的目录:web.xml最后添加下面配置。这样我们访问webapp下面的系统,都会转发成https了。
<security-constraint> <web-resource-collection> <web-resource-name>securedapp</web-resource-name> <url-pattern>/*</url-pattern> </web-resource-collection> <user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint>http://127.0.0.1:8080/xxx/login.jsp 会被转发成 https://127.0.0.1/xxx/login.jsp
相关文章推荐
- linux系统下用单向认证方式将Tomcat配置成https方式访问
- 配置tomcat https访问
- tomcat配置Https访问
- Tomcat配置https访问
- Tomcat配置https及访问http自动跳转至https
- Tomcat配置https与http自动跳转和tomcat单双向SSL配置及IE访问HTTPS下载文件失败
- 本地测试Tomcat配置Https访问
- Tomcat配置https及访问http自动跳转至https
- Tomcat配置部分页面Https访问
- Tomcat配置https及访问http自动跳转至https
- 【JAVA/HTTPS】JAVA生成ks,证书,tomcat配置HTTPS访问
- tomcat配置https访问
- tomcat配置,直接输入ip地址就可以访问系统
- window与Linux 配置 tomcat Https 访问
- Nginx+tomcat 配置https访问
- 创建https访问证书,增加证书到tomcat配置
- 本地Tomcat配置ssl 实现https访问
- 【网页访问单向、双向验证均可以】https原理及tomcat配置https方法[生成CA根证书配置tomcat后,若要成功访问axis中的webservice,需要配置它对应的axis2.xml文件]
- 配置Tomcat的HTTPS访问
- HTTP 403 ,tomcat配置HTTPS,无法访问 返回状态码HTTP 403