0

I have installed a certificate issued by Digicert on one of my web server. I then use another server of mine as a client to curl on my new certificate which is validated successfully.

While i was trying to get my self familiar with the whole certification procedures i noticed that the Root CA of my certificate is not installed on the client machine.

This is the openssl test from client to the server with the new cert:

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
dHJpcHN0YS5jb22CC3RyaXBzdGEuY29tMAkGA1UdEwQCMAAwKwYDVR0fBCQwIjAg
oB6gHIYaaHR0cDovL3RtLnN5bWNiLmNvbS90bS5jcm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BgkqhkiG9w0BAQsFAAOCAQEACp6DCReUspnUbiz09sPsJkTsXvxeh+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
aGF3dGUgRFYgU1NMIFNIQTI1NiBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC
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4oBi9v6z5J1Lt4+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-----

As far as i am aware, in order for the certificate to be verified the ROOT CA must be installed on the client system (my testserver). Therefore, since this certificate is indeed verified, that means that the Root CA from the above chain, that is, DigiCert Global Root G2, must be present on my machine.

Thing is i cannot find the specific root ca in my system. When i search for the installed Root CA on my system i only see three certificates:

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

There is only one DigiCert Root CA (not G2) and the certificate does not match with the one in the chain.

root@testserver:~# cat /usr/share/ca-certificates/mozilla/DigiCert_Global_Root_CA.crt 
-----BEGIN CERTIFICATE-----
MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcn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AGySj4dzp30d8tbQk
CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=
-----END CERTIFICATE-----  

How does the certificate gets verified since the Root CA is not installed on my system?

giomanda
  • 1,644
  • 4
  • 20
  • 30
  • Is it possible the server is sending the full chain with the root and curl is dumb enough to verify it with the root that was sent instead of finding one locally? – virullius Dec 14 '17 at 19:29
  • 1
    I'm confused about the chain. Cert #1 claims to be Issued by "thawte Primary Root CA - G3", but then Cert #2 is "DigiCert Global Root G2". Either this is broken or I don't understand how to read this output. – virullius Dec 14 '17 at 19:33
  • @mjb2kmn That's exactly where i also get confused. Strange thing is that it appears to be validated without issues. Also sslshopper indicates that the cert chains to be ok. – giomanda Dec 14 '17 at 20:12

0 Answers0