zoukankan      html  css  js  c++  java
  • https访问如何生成本地证书

    首先是HTTPS,我们知道使用HTTPS是需要证书的,所以接下来我们便制作一个证书。

    1.使用JDK自带的工具keytool

    keytool -genkey -alias caskeystore -keypass 123456 -keyalg RSA -keystore thekeystore

    2.导出数字证书

    keytool -export -alias caskeystore -keystore thekeystore -rfc -file cas.crt

     输入先前的密钥库口令,然后在当前目录下生成具体的cas.crt数字证书

    3.将证书导入到JDK中,出现如下图表示导出成功。注:这里输入密码是JDK的,如果没有修改过密码为:changeit

    1 keytool -import -alias caskeystore -keystore %JAVA_HOME%jrelibsecuritycacerts -file cas.crt -trustcacerts -storepass changeit

    (4)配置TOMCAT
        在tomcat目录下conf打开server.xml,找到84行,删除注释。
      

     修改前:
    <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
    maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
    clientAuth="false" sslProtocol="TLS" />
    修改后:
    <Connector port="8443" protocol="HTTP/1.1"
    maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
    clientAuth="false" sslProtocol="TLS" 
    keystoreFile="E:/cas/keys/cassso.keystore" keystorePass="123456"/>

    注意:keystoreFile=证书存放的路径,keystorePass=生成证书时设置的密码

    原文:https://blog.csdn.net/cl_andywin/article/details/53222858 




    【做一朵向日葵,面朝太阳,心纳阳光。心,只要有了充盈的阳光,就不再那么的冰;人,也就不再那么的冷;拥有了热度,心也跟着有了温度。】
  • 相关阅读:
    JavaWeb核心编程之(四.1)JSP
    一起来说 Vim 语
    你应该知道的基础 Git 命令
    Git 系列(五):三个 Git 图形化工具
    Git 系列(四):在 Git 中进行版本回退
    Git 系列(三):建立你的第一个 Git 仓库
    Git 系列(二):初步了解 Git
    Git 系列(一):什么是 Git
    JavaWeb核心编程之(三.6)HttpServlet
    多线程:子线程执行完成后通知主线程
  • 原文地址:https://www.cnblogs.com/walkingcamel/p/11134247.html
Copyright © 2011-2022 走看看