V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
miniyao
V2EX  ›  SSL

SSL 证书的公钥 domain.com.crt 里面的 3 个证书都有什么区别?

  •  
  •   miniyao · 2018-08-12 15:49:52 +08:00 · 2279 次点击
    这是一个创建于 2328 天前的主题,其中的信息可能已经有所发展或是发生改变。
    加速 https 需要上传 SSL 证书,打开公钥 domain.com.crt ,发现里面有 3 个证书:


    -----BEGIN CERTIFICATE-----
    MIIFSzCCBDOgAwIBAgIQHV3ex3xRLXOHkz2GjVAKrjANBgkqhkiG9w0BAQsFADCB
    kDELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G
    A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ06NT0RPIENBIExpbWl0ZWQxNjA0BgNV
    BAMTLUNPTU9ETyBSU0EgRG9tYWluIFZhbGlkYXRpb24gU2VjdXJlIFNlcnZlciBD
    QTAeFw0xODAyMDYwMDAwMDBaFw0xOTAyMDYyMzU5NTlaMFUxITAfBgNVBAsTGERv
    bWFpbiBDb250cm9sIFZhbGlkYXRlZDEaMBgGA1UECxMRQ09NU1NMIERvbWFpbiBT
    U0wxFDASBgNVBAMTC2V2ZXJ1cmwuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
    MIIBCgKCAQEA2qjKmjumrAneZcmANDbe60hsAvyiKry+X6Zd9d77V2vXfV0bfJRl
    7xF9IqDvzLgZGWCY04uWGqH4iHFP3wk57TSIB+Onz10ysiAgMPaPRLfjwgF/lWOO
    vVJMIaREwBiDx7HWb5Kd6i0uelpFmkp/bflD6KoWuV0ex09FSE7lZowM0npEvMqZ
    f5YnzHRI0eTZ96wH8asBe8iSW/ecBl1207bZUiVlhkqtXN8TEIIJSRJAcZGCKbPB
    VX7GYHYNKsc/rQlv/btZzLMhVw7isG5Vl6aEb+mTkCFbHvOnx5H/y1TDvvfNrjL5
    OQTLRZMVdM3zqXsVyKnn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I
    -----END CERTIFICATE-----
    -----BEGIN CERTIFICATE-----
    MIIGCDCCA/CgAwIBAgIQKy5u6tl1NmwUim7bo3yMBzANBgkqhkiG9w0BAQwFADCB
    hTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G
    A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNV
    BAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTQwMjEy
    MDAwMDAwWhcNMjkwMjExMjM1OTU5WjCBkDELMAkGA1UEBhMCR0IxGzAZBgNVBAgT
    EkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR
    Q09NT0RPIENBIExpbWl0ZWQxNjA0BgNVBAMTLUNPTU9ETyBSU0EgRG9tYWluIFZh
    bGlkYXRpb24gU2VjdXJlIFNlcnZlciBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP
    ADCCAQoCggEBAI7CAhnhoFmk6zg1jSz9AdDTScBkxwtiBUUWOqigwAwCfx3M28Sh
    bXcDow+G+eMGnD4LgYqbSRutA776S9uMIO3Vzl5ljj4Nr0zCsLdFXlIvNN5IJGS0
    Qa4Al/e+Z96e0HqnU4A7fK31llVvl0cKfIWLIpeNs4TgllfQcBhglo/uLQeTnaG6
    ytHNe+nEKpooIZFNb5JPJaXyejXdJtxGpdCsWTWM/06RQ1A/WZMebFEh7lgUq/51
    UHg+TLAchhP6a5i84DuUHoVS3AOTJBhuyydRReZw3iVDpA3hSqXttn7IzW3uLh0n
    c13cRTCAquOyQQuvvUSH2rnlG51/ruWFgqUCAwEAAaOCAWUwggFhMB8GA1UdIwQY
    MBaAFLuvfgI9+qbxPISOre44mOzZMjLUMB0GA1UdDgQWBBSQr2o6lFoL2JDqElZz
    30O0Oija5zAOBgNVHQ8BAf8EBAMCAYYwEgYDVR0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kHDSVneFeO/qJakXzlByjAA6quPbYzSf
    +AZxAeKCINT+b72x
    -----END CERTIFICATE-----
    -----BEGIN CERTIFICATE-----
    MIIFdDCCBFygAwIBAgIQJ2buVutJ846r13Ci/ITeIjANBgkqhkiG9w0BAQwFADBv
    MQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFk
    ZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b6JrMSIwIAYDVQQDExlBZGRUcnVzdCBF
    eHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFow
    gYUxCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO
    BgNVBAcTB1NhbGZvcmQxGjAYBgNVBAoTEUNPTU9ETyBDQSBMaW1pdGVkMSswKQYD
    VQQDEyJDT01PRE8gUlNBIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkq
    hkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAkehUktIKVrGsDSTdxc9EZ3SZKzejfSNw
    AHG8U9/E+ioSj0t/EFa9n3Byt2F/yUsPF6c947AEYe7/EZfH9IY+Cvo+XPmT5jR6
    2RRr55yzhaCCenavcZDX7P0N+pxs+t+wgvQUfvm+xKYvT3+Zf7X8Z0NyvQwA1onr
    ayzT7Y+YHBSrfuXjbvzYqOSSJNpDa2K4Vf3qwbxstovzDo2a5JtsaZn4eEgwRdWt
    4Q08RWD8MpZRJ7xnw8outmvqRsfHIKCxH2XeSAi6pE6p8oNGN4Tr6MyBSENnTnIq
    m1y9TBsoilwie7SrmNnu6FGDwwlGTm0+mfqVF9p8M1dBPI1R7Qu2XK8sYxrfV8g/
    vOldxJuvRZnio1oktLqpVj3Pb6r/SVi+8Kj/9Lit6Tf7urj0Czr56ENCHonYhMsT
    8dm74YlguIwoVqwUHZwK53Hrzw7dPamWoUi9PPevtQ0iTMARgexWO/bTouJbt7IE
    IlKVgJNp6I5MZfGRAy1wdALqi2cVKWlSArvX31BqVUa/oKMoYX9w0MOiqiwhqkfO
    KJwGRXa/ghgntNWutMtQ5mv0TIZxMOmm3xaG4Nj/QN370EKIf6MzOi5cHkERgWPO
    GHFrK+ymircxXDpqR+DDeVnWIBqv8mqYqnK8V0rSS527EPywTEHl7R09XiidnMy/
    s1Hap0flhFMCAwEAAaOB9DCB8TAfBgNVHSMEGDAWgBStvZh6NLQm9/rEJlTvA73g
    JMtUGjAdBgNVHQ4EFgQUu69+Aj36pvE8hI6t7jiY7NkyMtQwDgYDVR0PAQH/BAQD
    AgGGMA8GA1UdEwEB/wQFMAMBAf8wEQYDVR0gBAowCDAGBgRVHSAAMEQGA1UdHwQ9
    MDswOaA3oDWGM2h0dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9BZGRUcnVzdEV4dGVy
    bmFsQ0FSb290LmNybDA1BggrBgEFBQcBAQQpMCcwJQYIKwYBBQUHMAGGGWh0dHA6
    Ly9vY3NwLnVzZXJ0cnVzdC5jb20wDQYJKoZIhvcNAQEMBQADggEBAGS/g/FfmoXQ
    zbihKVcN6Fr30ek+8nYEbvFScLsePP9NDXRqzIGCJdPDoCpdTPW6i6FtxFQJdcfj
    Jw5dhHk3QBN39bSsHNA7qxcS1u80GH4r6XnTq1dFDK8o+tDb5VCViLvfhVdpfZLY
    Uspzgb8c8+a4bmYRBbMelC1/kZWSWfFMzqORcUx8Rww7Cxn2obFshj5cqsQugsv5
    B5a6SE2Q8pTIqXOi6wZ7I53eovNNVZ96YUWYGGjHXkBrI/V5eu+MtWuLt29G9Hvx
    PUsE2JOAWVrgQSQdso8VYFhH2+9uRv0V9dlfmrPb2LjkQLPNlzmuhbsdjrzch5vR
    pu/xO28QOG8=
    -----END CERTIFICATE-----
    5 条回复    2018-08-12 18:52:04 +08:00
    nlzy
        1
    nlzy  
       2018-08-12 15:53:52 +08:00 via Android   ❤️ 1
    证书链。一般是一个用户证书,一个中间证书,和一个根证书。
    miniyao
        2
    miniyao  
    OP
       2018-08-12 16:09:15 +08:00
    @nlzy 不知道对方 https 的 web 服务器是哪个版本,试了下,貌似随便传哪个都可以。

    是不是三个一起传最规范,保证完整证书链?
    chinvo
        3
    chinvo  
       2018-08-12 16:45:04 +08:00   ❤️ 1
    不是随便哪个都可以

    一般来讲,只有传用户证书才能正常工作,可以同时传 用户证书和中间证书 或者 用户证书和中间证书和根证书

    注意这些证书必须在同一个文件里面
    sujin190
        4
    sujin190  
       2018-08-12 18:39:39 +08:00 via Android
    既然申请签发时就是这么给你的,你就这么上传就是了啊,又没说要你再处理
    Remember
        5
    Remember  
       2018-08-12 18:52:04 +08:00
    一般只需要用户证书+中间证书就可以了, 根证书不用船, 除非你这个证书链不是三级,而是有两个中间证书.
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3189 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 12:43 · PVG 20:43 · LAX 04:43 · JFK 07:43
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.