zoukankan      html  css  js  c++  java
  • 在Windows下用OpenSSL生成证书步骤

    1.签根证书:
    openssl genrsa -des3 -out rootca.key 1024
    openssl req -new -key rootca.key -out rootca.csr -config F:\xampp\apache\bin\openssl.cnf
    openssl req -x509 -days 365 -key rootca.key -in rootca.csr -out rootca.crt -config F:\xampp\apache\bin\openssl.cnf

    2.签服务端证书 :
    openssl genrsa -des3 -out server.key 1024
    openssl rsa -in server.key -out server.key.unsecure
    openssl req -new -key server.key -out server.csr -config F:\xampp\apache\bin\openssl.cnf
    openssl ca -in server.csr -out server.crt -cert rootca.crt -keyfile rootca.key -config F:\xampp\apache\bin\openssl.cnf

    3.签客户端证书:
    openssl genrsa -des3 -out client.key 1024
    openssl req -new -key client.key -out client.csr -config F:\xampp\apache\bin\openssl.cnf
    openssl ca -in client.csr -out client.crt -cert rootca.crt -keyfile rootca.key -config F:\xampp\apache\bin\openssl.cnf
    openssl pkcs12 -export -clcerts -in client.crt -inkey client.key -out client.pfx

    如果在签发证书时候提示demoCA找不到,则需要修改如下配置

    修改:openssl.cnf 的 dir
    mkdir demoCA
    mkdir demoCA/newcerts
    mkdir demoCA/private
    touch demoCA/index.txt
    echo “01″ >> demoCA/serial

    以上证书都能正常生成,但是部署到apache时候,请求客户端证书总是失败。
    SSLVerifyClient require
    SSLVerifyDepth 1
    SSLCACertificateFile /etc/apache2/conf/ssl/my-ca.crt
    查看了错误日志,问题出现在SSLCACertificateFile。
    具体还不知道什么原因。

  • 相关阅读:
    坑爹的VS2012
    View Properties [AX 2012]
    Understanding the RelationshipType Enumeration [AX 2012]
    《操作系统概念》学习笔记-第二章
    《操作系统概念》学习笔记-第一章
    操作系统云课堂笔记
    C#学习笔记
    github生成SSH公钥
    【笔记】第一次将网站部署到服务器上
    windows下postgresql安装失败解决方法:无法运行getlocales.exe
  • 原文地址:https://www.cnblogs.com/uniqid/p/4154617.html
Copyright © 2011-2022 走看看