根 CA 未安装但证书已成功验证

根 CA 未安装但证书已成功验证

我已经在我的一台 Web 服务器上安装了 Digicert 颁发的证书。然后我使用我的另一台服务器作为客户端来 curl 我的证书,该证书已成功验证。

当我尝试熟悉整个认证程序时,我注意到我的证书的根 CA 尚未安装在客户端机器上。

这是使用新证书从客户端到服务器进行的 openssl 测试:

root@testserver# openssl s_client -showcerts -connect server_ip:443 -servername www.my-site.com
CONNECTED(00000003)
depth=2 C = US, O = "thawte, Inc.", OU = Certification Services Division, OU = "(c) 2008 thawte, Inc. - For authorized use only", CN = thawte Primary Root CA - G3
verify return:1
depth=1 C = US, O = "thawte, Inc.", OU = Domain Validated SSL, CN = thawte DV SSL SHA256 CA
verify return:1
depth=0 CN = www.my-site.com
verify return:1
---
Certificate chain
 0 s:/CN=www.my-site.com
   i:/C=US/O=thawte, Inc./OU=Domain Validated SSL/CN=thawte DV SSL SHA256 CA
-----BEGIN CERTIFICATE-----
MIIGgTCCBWmgAwIBAgIQeAl/4qdt51FNSG+IXqEadzANBgkqhkiG9w0BAQsFADBl
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhhd3RlLCBJbmMuMR0wGwYDVQQLExRE
b21haW4gVmFsaWRhdGVkIFNTTDEgMB4GA1UEAxMXdGhhd3RlIERWIFNTTCBTSEEy
NTYgQ0EwHhcNMTcwODA3MDAwMDAwWhcNMjAwOTA1MjM1OTU5WjAaMRgwFgYDVQQD
DA93d3cudHJpcHN0YS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
AQCtqpGTNlGyxHGEWBSfMRLIPC1gk3THoSA8VsHQT9022dQhff49m6/dqfyzDJJk
Hg0+bbfJvX+An8n+Qx/tMTjkA3YIvDvbGf3g5k6LezBF2cIWteFOWSDdoWSVyyjy
BWuVE0XRHMNOOrLcDMP7M4ntAgMBAAGjggN2MIIDcjAnBgNVHREEIDAegg93d3cu
dHJpcHN0YS5jb22CC3RyaXBzdGEuY29tMAkGA1UdEwQCMAAw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ZG8sDGTf9yNMAiBwLrGPviP/SwCSWj4t1UCMILa6WY62F9oANVX0Jezz
+TANBgkqhkiG9w0BAQsFAAOCAQEACp6DCReUspnUbiz09sPsJkTsXvxeh+N+Ihl7
X2qqPxW3enFzcZGyeIfbREuxOMejOXoFn0jMmVRhulyOvkugSYinYj8eWc6OJa/m
a1hfB50A5meDJagYAkjL1hhSZLVnxHJSvfAUTR6UUazaKr8B9ZFt/pl3u1rW7hxQ
+ffuxCAuFZU3F5YIser4D1UzWBeLAqBuD+1sKT12kDBICwPhL5yI2WTwGzAPlbz9
dmU5vCK+YVxMlU4FKEkkzBtzmxovHVnEKf2UVeF2QfjpDsKHwetCxXH0GDAByiuc
JV+Aq4zGZzEikjmF2n+Is2Mjbjvf9gygDGpwg3hOqUMO9MKdyw==
-----END CERTIFICATE-----
 1 s:/C=US/O=thawte, Inc./OU=Domain Validated SSL/CN=thawte DV SSL SHA256 CA
   i:/C=US/O=thawte, Inc./OU=Certification Services Division/OU=(c) 2008 thawte, Inc. - For authorized use only/CN=thawte Primary Root CA - G3
-----BEGIN CERTIFICATE-----
MIIE3DCCA8SgAwIBAgIQPiM0Wu0sClF7Jt7UgB0QqjANBgkqhkiG9w0BAQsFADCB
rjELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMf
Q2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIw
MDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNV
BAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0xNDA2MTAwMDAwMDBa
Fw0yNDA2MDkyMzU5NTlaMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwx0aGF3dGUs
IEluYy4xHTAbBgNVBAsTFERvbWFpbiBWYWxpZGF0ZWQgU1NMMSAwHgYDVQQDExd0
aGF3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+CWSkyVy40jkLeQKeFTkdwNnNHF9odo3z
Hi36v6dJog2X9ZbC6WzUzUcLi4oBi9v6z5J1Lt4+p3O1/gNRp0LDx0JrqW++9iDh
jr+fCY7lCOiSk3c+SUScf+l5nf9Lr+A4VzQNXxEyEpKpYYiBpR74oPBFWoZxIIWF
-----END CERTIFICATE-----
 2 s:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert Global Root G2
   i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert Global Root G2
-----BEGIN CERTIFICATE-----
MIIDjjCCAnagAwIBAgIQAzrx5qcRqaC7KGSxHQn65TANBgkqhkiG9w0BAQsFADBh
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBH
MjAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAwMDBaMGExCzAJBgNVBAYTAlVT
MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEcyMIIBIjANBgkqhkiG
9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuzfNNNx7a8myaJCtSnX/RrohCgiN9RlUyfuI
2/Ou8jqJkTx65qsGGmvPrC3oXgkkRLpimn7Wo6h+4FR1IAWsULecYxpsMNzaHxmx
1x7e/dfgy5SDN67sH0NO3Xss0r0upS/kqbitOtSZpLYl6ZtrAGCSYP9PIUkY92eQ
q2EGnI/yuum06ZIya7XzV+hdG82MHauVBJVJ8zUtluNJbd134/tJS7SsVQepj5Wz
tCO7TG1F8PapspUwtP1MVYwnSlcUfIKdzXOS0xZKBgyMUNGPHgm+F6HmIcr9g+UQ
vIOlCsRnKPZzFBQ9RnbDhxSJITRNrw9FDKZJobq7nMWxM4MphQIDAQABo0IwQDAP
BgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUTiJUIBiV
5uNu5g/6+rkS7QYXjzkwDQYJKoZIhvcNAQELBQADggEBAGBnKJRvDkhj6zHd6mcY
1Yl9PMWLSn/pvtsrF9+wX3N3KjITOYFnQoQj8kVnNeyIv/iPsGEMNKSuIEyExtv4
NeF22d+mQrvHRAiGfzZ0JFrabA0UWTW98kndth/Jsw1HKj2ZL7tcu7XUIOGZX1NG
Fdtom/DzMNU+MeKNhJ7jitralj41E6Vf8PlwUHBHQRFXGU7Aj64GxJUTFy8bJZ91
8rGOmaFvE7FBcf6IKshPECBV1/MUReXgRPTqh5Uykw7+U0b6LJ3/iyK5S9kJRaTe
pLiaWN0bfVKfjllDiIGknibVb63dDcY3fe0Dkhvld1927jyNxF1WW6LZZm6zNTfl
MrY=
-----END CERTIFICATE-----

据我所知,为了验证证书,必须在客户端系统(我的测试服务器)上安装 ROOT CA。因此,由于此证书确实已验证,这意味着来自上述链的 Root CA,即DigiCert 全球根 G2,必须存在于我的机器上。

问题是我无法在系统中找到特定的根 CA。当我在系统上搜索已安装的根 CA 时,我只看到三个证书:

root@testserver:~# ls -l /usr/share/ca-certificates/mozilla/DigiCert_*
-rw-r--r-- 1 root root 1350 Sep 24  2014 /usr/share/ca-certificates/mozilla/DigiCert_Assured_ID_Root_CA.crt
-rw-r--r-- 1 root root 1338 Sep 24  2014 /usr/share/ca-certificates/mozilla/DigiCert_Global_Root_CA.crt
-rw-r--r-- 1 root root 1367 Sep 24  2014 /usr/share/ca-certificates/mozilla/DigiCert_High_Assurance_EV_Root_CA.crt

只有一个 DigiCert 根 CA(不是 G2),并且证书与链中的证书不匹配。

root@testserver:~# cat /usr/share/ca-certificates/mozilla/DigiCert_Global_Root_CA.crt 
-----BEGIN CERTIFICATE-----
MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh
MQswCQYD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4L0na4UU+Krk2U886UAb3LujEV0ls
YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk
CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=
-----END CERTIFICATE-----  

由于我的系统上没有安装根 CA,如何验证证书?

相关内容