1.首先用jdk自带的工具keytool生成一个证书keystore
C:\Documents and Settings\Administrator>keytool -genkey -alias sxta -keyalg RSA
-keystore D:\sxta.keystore
Enter keystore password: sxta
Keystore password is too short - must be at least 6 characters
Enter keystore password: sxtaweb
What is your first and last name?
[Unknown]: **
What is the name of your organizational unit?
[Unknown]: 山西**科技有限公司
What is the name of your organization?
[Unknown]: 山西**科技有限公司
What is the name of your City or Locality?
[Unknown]: 太原
What is the name of your State or Province?
[Unknown]: 山西
What is the two-letter country code for this unit?
[Unknown]: cn
Is <CN=, OU=q?npW?q?? Pl?, O=q?npW?q?? Pl?, L=*?, ST=q, C=cn>
correct?
[no]: y
Enter key password for <sxta>
(RETURN if same as keystore password):
C:\Documents and Settings\Administrator>
2.http://java.sun.com/products/archive/jsse/ 去下载jsse,下载下来后是一个zip包,把里边lib目录下的jar包jcert.jar, jnet.jar, jsse.jar拷贝到$JAVA_HOME/jre/lib/ext
3.修改tomcat目录下的server.xml文件,增加
<Connector
port="8443" protocol="HTTP/1.1" minSpareThreads="5" maxSpareThreads="75"
enableLookups="true" disableUploadTimeout="true"
acceptCount="100" maxThreads="200"
scheme="https" secure="true" SSLEnabled="true"
keystoreFile="d:/credit.keystore" keystorePass="creditworld"
clientAuth="false" sslProtocol="TLS"/>
其中keystorePass的值为生成keystore时输入的密码,keystoreFile的值为证书存放的路径.
4.web.xml 增加
<security-constraint>
<web-resource-collection>
<web-resource-name>sslapp</web-resource-name>
<url-pattern>/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
分享到:
相关推荐
资源包括java服务端和安卓客户端的测试源码,按照配置文档配置好tomcat https,将客户端的server_trust.keystore文件替换成你自己的,直接运行即可,两个jar文件随便选个,我用的JDK15
该文档提供JKS转换为PFX的方法 使用JWSDP工具包中的工具 •安装J2SE 1.5,下载并运行jdk-1_5_0_09-windows-i586-p.exe •下载并安装jave web service develop pack, jwsdp-2_0-windows-i586.exe •创建一个新的...
sprintboot项目undertow替换tomcat方法,详细介绍了springboot项目如何把tomcat服务替换成性能更优的undertow服务
因为tomcat默认支持的是http访问,若需要支持https访问,需要将该文件添加到tomcat的根目录,然后修改conf目录下的server.xml, 将:<Connector port="8080" protocol="org.apache.coyote.http11.Http11NioProtocol"...
seesion共享需替换tomcat下lib的包
Tomcat7免安装版Tomcat7免安装版Tomcat7免安装版Tomcat7免安装版Tomcat7免安装版
直接将该下载包解压到tomcat 7.0.42 lib 包下替换即可
为避免出问题 替换前请备份源文件, 环境变量中设置 CATALINA_HOME_FILE CATALINA_BASE_FILE 这两个为tomcat跟目录 , JAVA_HOME_FILE jdk所在的目录 , CLASSPATHFILE 值为.;%JAVA_HOME_FILE%\lib;%JAVA_HOME_FILE%...
window版本,使用nginx+tomcat实现集群架构。包含http集群和https2钟方式集群,解压即可以用。证书什么都已经配置好了。如果商业证书直接替换就可以了。
TongWeb和Tomcat的区别.doc
NULL 博文链接:https://japankn.iteye.com/blog/577931
JerryMouse 模仿tomcat的国产开源web服务器,希望可以将交互做的更好,
apache+tomcat集群配置文件,下载下来,直接就能用,很方便,apache是2.0的
tomcat、jboss 连接池配置,详细步骤,准确代码,让你实践中学会这两种服务器的连接池配置
直接进入lib文件夹: 源文件:commons-fileupload-1.4.jar 目的:tomcat10版本导致List<FileItem> fileItems = sfu.parseRequest(request) ...参考说明地址:https://github.com/apache/tomcat-jakartaee-migration
1.tomcat源码文件 2.tomcat程序文件 3.Ant程序文件 4.tomcat源码在eclipse运行,重新编译,重新打包步骤文件 5.一个tomcat源码在eclipse上运行的java工程 作用: 1.用于学习tomcat源码和了解tomcat运行机制 2.学习...
你只需要下载这个文件包中的配置文件模板,虽后放到ofbiz1004\framework\appserver\templates\tomcat6下替换原来的文件,然后再到ofbiz目录下运行java -jar ofbiz.jar -setup tomcat6 ,完成后会得到一个setup的文件...
tomcat配置自身错误页面,直接替换tomcat本身的root文件夹即可。然后修改web.xml,具体方式详见:https://blog.csdn.net/f552126367/article/details/107999676
tomcat下的lib的jar包,把这上面的所有jar包全选复制,然后粘贴到lib下就行了。