无法使用" custom"代理服务器中的SSL证书(内置工作)

时间:2017-12-17 23:17:45

标签: ssl proxy openssl ssl-certificate

我试图配置Titanium Web代理以使用我自己的SSL证书(好的,我需要再次生成我的证书,因为我刚删除它们)。

  

首先:我的用例工作正常,我需要拦截https流量和   我在.NET Core应用程序中设置了Titanium。它生成和   配置/安装了" rootCert.pfx"文件,我可以拦截   https流量。

     

参考:https://github.com/justcoding121/Titanium-Web-Proxy/wiki#custom-root-certificates

引用的页面说我可以使用代理服务器上的RootCertificate属性设置自定义根证书

所以我创建了一个证书:

openssl req -x509 -sha256 -nodes -newkey rsa:2048 -days 365 -keyout localhost.key -out localhost.crt

将其转换为pfx

openssl pkcs12 -export -out localhost.pfx -inkey localhost.key -in localhost.crt

将其复制到输出目录并将其配置为RootCertificate

但现在我的浏览器会说出任何https请求:

  

ERR_CONNECTION_CLOSED

我尝试双击并安装crt文件,但这没有帮助..

我在这里丢失了哪些证书。为了让事情变得更复杂,GenericCertificate类上还有ExplicitProxyEndPoint属性...如果我在那里配置了根证书,那么我的浏览器会返回:

  

ERR_CERT_AUTHORITY_INVALID

非常感谢任何指导或提示!

第二次尝试(剧透:再次失败)

  1. 创建 CA密钥 customCA.key

      

    openssl genrsa -des3 -out customCA.key 2048

  2. 创建 CA根证书 customCA.pem

      

    openssl req -x509 -new -nodes -key customCA.key -sha256 -days 1825 -out customCA.pem

  3. 信任 CA根证书:导入 customCA.pem

      

    Import certificate here Certificate properties

  4. 创建 localhost密钥 localhost.key

      

    openssl genrsa -out localhost.key 2048

  5. 创建 localhost签名请求 localhost.csr

      

    openssl req -new -key localhost.key -out localhost.csr

  6. 创建自定义分机选项 localhost.ext

  7.     [ req ]
        default_bits        = 2048 
        default_keyfile     = customCA.pem 
        distinguished_name  = req_distinguished_name
        req_extensions          = v3_req
        x509_extensions         = v3_ca
    
        [req_distinguished_name]
        C = [Press Enter to Continue]
        C_default = US 
        C_min = 2 
        C_max = 2 
    
        O = [Press Enter to Continue]
        O_default = default 
    
        0.OU=[Press Enter to Continue]
        0.OU_default = default 
        1.OU=[Press Enter to Continue]
        1.OU_default = PKI 
        2.OU=[Press Enter to Continue] 
        2.OU_default = ABCD
        commonName = Public FQDN of server 
        commonName_max = 64
        emailAddress = [Press Enter to Continue] 
        emailAddress_default = myEmail@email.com
    
        [ v3_req ]
        basicConstraints = CA:TRUE
        keyUsage = digitalSignature, nonRepudiation, keyEncipherment
    
        [ v3_ca ]
        subjectKeyIdentifier   = hash
        authorityKeyIdentifier = keyid:always,issuer:always
        subjectAltName         = email:myEmail@email.com
        issuerAltName          = issuer:copy
    
    1. 创建签名的本地主机证书 localhost.crt

        

      openssl x509 -req -in localhost.csr -CA customCA.pem -CAkey customCA.key -CAcreateserial -out localhost.crt -days 1825 -sha256 -extfile localhost.ext

    2. 签名的本地主机证书从crt转换为pfx localhost.pfx

        

      openssl pkcs12 -export -out localhost.pfx -inkey localhost.key -in localhost.crt

    3. 现在,如果我将localhost.pfx指定为代理服务器的RootCertificate(由于它由customCA签名,我假设它将被信任这是一个值得信赖的权威机构)我仍然得到:

        

      ERR_CONNECTION_CLOSED

      我开始对RootCertificateCertificate Authority感到困惑。似乎代理服务器需要两者兼而有之?

0 个答案:

没有答案
相关问题