服务器 resin (固然也能够是tomcat,这里以resin为例)浏览器
安装jdktomcat
域名 (随便写一个就行,由于是内网使用,不会被校验)安全
keytool -genkey -alias resin -keypass 123456 -keyalg RSA -keysize 1024 -validity 365 -keystore D:/keys/resin.keystore -storepass 123456
服务器
keytool -genkey -alias client1 -keypass 123456 -keyalg RSA -keysize 1024 -validity 365 -storetype PKCS12 -keystore D:/keys/client1.p12 -storepass 123456
cookie
keytool -export -alias client1 -keystore D:/keys/client1.p12 -storetype PKCS12 -keypass 123456 -file D:/keys/client1.cer
session
keytool -import -v -file D:/keys/client1.cer -keystore D:/keys/resin.keystore -storepass 123456
url
keytool -list -v -keystore D:/keys/resin.keystore
spa
keytool -keystore D:/keys/resin.keystore -export -alias resin -file D:/keys/server.cer
3d
注意:当提示:您的名字与姓氏是什么? 请输入你准备的域名好比:www.aclululu.comcode
其余的按照提示输入就是了,最后会获得四个文件以下:
双击server.cer文件,按默认安装,直到安装成功
打开IE浏览器,找到证书
选择导出,导出的证书便可用于其余客户进行安装使用。这里命名为aclululu_client
早期的版本,由于没有最新的,因此请见谅!
resin.conf文件具体须要修改的地方
<http address="*" port="443">
<jsse-ssl> <key-store-type>jks</key-store-type> <key-store-file>keys/resin.keystore</key-store-file> <password>123456</password> </jsse-ssl> </http>
<session-config>
<session-timeout>-1</session-timeout> <enable-url-rewriting>false</enable-url-rewriting> <reuse-session-id>false</reuse-session-id> <cookie-secure >true</cookie-secure> </session-config>
<cookie-http-only>true</cookie-http-only>
<secure>true</secure>
打开IE浏览器,导入证书
按照默认导入刚刚保存的aclululu_client证书。直到导入成功。
修改host文件
假如服务器的ip为:172.16.1.123
方法一:
修改批处理文件:aclululu_host.bat
@echo off
color 0F
@attrib -r "%windir%\system32\drivers\etc\hosts"
@echo= >>"%windir%\system32\drivers\etc\hosts"
@echo= >>"%windir%\system32\drivers\etc\hosts"
@echo #Fssoft Start >>"%windir%\system32\drivers\etc\hosts"
@echo 172.16.1.123 www.aclululu.com>>"%windir%\system32\drivers\etc\hosts"
@echo #Fssoft End >>"%windir%\system32\drivers\etc\hosts"
@echo= >>"%windir%\system32\drivers\etc\hosts"
@echo= >>"%windir%\system32\drivers\etc\hosts"
@attrib +r "%windir%\system32\drivers\etc\hosts"
而后双击执行bat便可
方法二:
直接去
C:\Windows\System32\drivers\etc下手动修改
https
就能够安全访问172.16.1.123这台主机上的网页了
原文连接:https://www.jianshu.com/p/631719c9f0c6