PHP Get SSL Certificate Info via CURL


The CURLOPT_CERTINFO option requires PHP >= 5.3.2, and apparently requires CURLOPT_VERBOSE to be set.
<?php
if($fp = tmpfile())
{
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL,"https://my.atlassian.com/login");
    curl_setopt($ch, CURLOPT_STDERR, $fp);
    curl_setopt($ch, CURLOPT_CERTINFO, 1);
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_HEADER, 1);
    curl_setopt($ch, CURLOPT_NOBODY, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,  2);
    $result = curl_exec($ch);
    curl_errno($ch)==0 or die("Error:".curl_errno($ch)." ".curl_error($ch));
    fseek($fp, 0);//rewind
    $str='';
    while(strlen($str.=fread($fp,8192))==8192);
    echo $str;
    fclose($fp);
}
?>

output:
HTTP/1.1 200 OK
Date: Sat, 06 Oct 2012 05:02:28 GMT
Set-Cookie: JSESSIONID=5B4B5F2F5F21C9541FD54A638F5906F2; Path=/; Secure; HttpOnly
Content-Type: text/html;charset=utf-8
Content-Language: en-US
Content-Length: 8192
Vary: Accept-Encoding
 
* About to connect() to my.atlassian.com port 443 (#0)
*   Trying 67.221.237.13... * connected
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* SSL connection using DHE-RSA-AES256-SHA
* --- Certificate chain
*  0 Subject: C=AU; ST=NSW; L=Sydney; O=ATLASSIAN PTY LTD; OU=IT; CN=*.atlassian.com
*    Issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert High Assurance CA-3
*    Version: 3 (0x2)
*    Serial Number: 
*    Signature Algorithm: sha1WithRSAEncryption
*    Start date: 2011-01-04 00:00:00 GMT
*    Expire date: 2014-01-27 23:59:59 GMT
*    Public Key Algorithm: rsaEncryption
*    RSA Public Key (1024 bits)
*    rsa(n): ca:8d:3d:96:34:96:91:2c:2d:aa:fd:01:27:76:37:55:b6:b8:92:fe:a3:10:7d:e5:fe:b1:78:33:e2:d4:8d:fa:37:75:ce:ea:4e:ce:e0:e8:c5:47:d3:8a:55:4b:22:df:1a:47:9f:db:49:af:97:63:7c:a4:8f:94:5c:35:1c:64:8b:b4:3f:ae:bd:f4:14:03:58:dd:c2:82:c5:8d:93:61:98:d5:a0:f6:15:8a:99:d6:54:3b:9b:b6:98:ef:53:2c:04:e8:4e:4b:c0:8d:f7:a0:5a:aa:9e:12:fe:1f:31:0e:8a:85:ce:04:77:54:db:fb:59:1e:3f:27:d1:54:7b:85:
*    rsa(e): 01:00:01:
* X509v3 Authority Key Identifier: 
*   keyid:50:EA:73:89:DB:29:FB:10:8F:9E:E5:01:20:D4:DE:79:99:48:83:F7
* X509v3 Subject Key Identifier: 
*   E8:9B:0D:CE:40:DB:10:47:01:FF:0C:06:A9:DA:10:54:09:B3:04:01
* X509v3 Subject Alternative Name: 
*   DNS:*.atlassian.com,DNS:atlassian.com
* Authority Information Access: 
*   OCSP-URI:http://ocsp.digicert.com, CAIssuers-URI:http://cacerts.digicert.com/DigiCertHighAssuranceCA-3.crt
* X509v3 Key Usage: (critical)
*   DigitalSignature,KeyEncipherment
* X509v3 Basic Constraints: (critical)
*   CA:FALSE
* X509v3 CRL Distribution Points: 
*   , FullName:, URI:http://crl3.digicert.com/ca3-2010i.crl, 
FullName:, URI:http://crl4.digicert.com/ca3-2010i.crl
* X509v3 Certificate Policies: 
*   Policy:2.16.840.1.114412.1.3.0.1, CPS:http://www.digicert.com/ssl-cps-repository.htm, UserNotice:, ExplicitText:
 
* X509v3 Extended Key Usage: 
*   TLSWebServerAuthentication,TLSWebClientAuthentication
*  Signature: 65:dc:b8:62:49:82:6c:6a:bd:69:45:de:2a:0c:47:9f:fa:5a:22:64:57:95:06:b2:d1:b0:77:16:89:af:b5:2d:79:2f:63:96:d7:e0:a0:46:dc:f1:9c:20:ef:32:86:82:3a:66:d1:a5:30:e8:c0:d6:ac:c3:01:a0:1f:c1:b7:c3:15:a3:a4:48:80:4b:b4:6e:9b:25:34:75:2e:d9:f8:13:26:78:a7:de:af:fd:89:2a:b2:39:e0:91:38:7f:89:67:a8:4a:5f:c3:b2:68:61:3f:6a:e7:73:1d:8b:62:64:1f:60:8b:a0:fc:b3:0a:7c:2d:33:72:93:ba:3f:28:69:e7:c5:3c:cc:8d:cd:89:ae:31:9d:08:98:e9:d7:a2:b3:be:89:1b:66:6c:1a:91:09:65:60:e8:09:f1:36:fe:19:c9:89:b0:a3:17:be:32:ab:3c:d7:9b:39:e8:ae:a0:e0:e4:db:86:7c:54:bb:66:2b:97:84:10:3f:99:42:b3:8e:3f:1f:2e:e7:a5:d6:49:e3:2b:ae:47:64:70:a8:fe:bb:79:5d:b6:63:ed:99:93:c2:32:09:3a:dc:b1:17:e8:12:87:a5:bd:fe:05:d3:2a:24:79:26:bc:81:e3:dc:87:f5:a8:c2:a1:dd:9d:d4:60:4a:fd:9f:87:8c:4f:4a:d3:ec:db:
* -----BEGIN CERTIFICATE-----
MIIGNzCCBR+gAwIBAgIQBQaWIwRPddWFyK7QL8SexTANBgkqhkiG9w0BAQUFADBm
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMSUwIwYDVQQDExxEaWdpQ2VydCBIaWdoIEFzc3VyYW5j
ZSBDQS0zMB4XDTExMDEwNDAwMDAwMFoXDTE0MDEyNzIzNTk1OVowbzELMAkGA1UE
BhMCQVUxDDAKBgNVBAgTA05TVzEPMA0GA1UEBxMGU3lkbmV5MRowGAYDVQQKExFB
VExBU1NJQU4gUFRZIExURDELMAkGA1UECxMCSVQxGDAWBgNVBAMUDyouYXRsYXNz
aWFuLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAyo09ljSWkSwtqv0B
J3Y3Vba4kv6jEH3l/rF4M+LUjfo3dc7qTs7g6MVH04pVSyLfGkef20mvl2N8pI+U
XD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AbQBpAHQAIABsAGkAYQBiAGkAbABp
AHQAeQAgAGEAbgBkACAAYQByAGUAIABpAG4AYwBvAHIAcABvAHIAYQB0AGUAZAAg
AGgAZQByAGUAaQBuACAAYgB5ACAAcgBlAGYAZQByAGUAbgBjAGUALjAdBgNVHSUE
FjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQEFBQADggEBAGXcuGJJ
gmxqvWlF3ioMR5/6WiJkV5UGstGwdxaJr7UteS9jltfgoEbc8Zwg7zKGgjpm0aUw
6MDWrMMBoB/Bt8MVo6RIgEu0bpslNHUu2fgTJnin3q/9iSqyOeCROH+JZ6hKX8Oy
aGE/audzHYtiZB9gi6D8swp8LTNyk7o/KGnnxTzMjc2JrjGdCJjp16KzvokbZmwa
kQllY*  1 Subject: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert High Assurance CA-3
*    Issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert High Assurance EV Root CA
*    Version: 3 (0x2)
*    Serial Number: 
*    Signature Algorithm: sha1WithRSAEncryption
*    Start date: 2007-04-03 00:00:00 GMT
*    Expire date: 2022-04-03 00:00:00 GMT
*    Public Key Algorithm: rsaEncryption
*    RSA Public Key (2048 bits)
*    rsa(n): bf:61:0a:29:10:1f:5e:fe:34:37:51:08:f8:1e:fb:22:ed:61:be:0b:0d:70:4c:50:63:26:75:15:b9:41:88:97:b6:f0:a0:15:bb:08:60:e0:42:e8:05:29:10:87:36:8a:28:65:a8:ef:31:07:74:6d:36:97:2f:28:46:66:04:c7:2a:79:26:7a:99:d5:8e:c3:6d:4f:a0:5e:ad:bc:3d:91:c2:59:7b:5e:36:6c:c0:53:cf:00:08:32:3e:10:64:58:10:13:69:c7:0c:ee:9c:42:51:00:f9:05:44:ee:24:ce:7a:1f:ed:8c:11:bd:12:a8:f3:15:f4:1c:7a:31:69:01:1b:a7:e6:5d:c0:9a:6c:7e:09:9e:e7:52:44:4a:10:3a:23:e4:9b:b6:03:af:a8:9c:b4:5b:9f:d4:4b:ad:92:8c:ce:b5:11:2a:aa:37:18:8d:b4:c2:b8:d8:5c:06:8c:f8:ff:23:bd:35:5e:d4:7c:3e:7e:83:0e:91:96:05:98:c3:b2:1f:e3:c8:65:eb:a9:7b:5d:a0:2c:cc:fc:3c:d9:6d:ed:cc:fa:4b:43:8c:c9:d4:b8:a5:61:1c:b2:40:b6:28:12:df:b9:f8:5f:fe:d3:b2:c9:ef:3d:b4:1e:4b:7c:1c:4c:99:36:9e:3d:eb:ec:a7:68:5e:1d:df:67:6e:5e:fb:
*    rsa(e): 01:00:01:
* X509v3 Key Usage: (critical)
*   DigitalSignature,CertificateSign,CRLSign
* X509v3 Certificate Policies: 
*   Policy:2.16.840.1.114412.1.3.0.2, CPS:http://www.digicert.com/ssl-cps-repository.htm, UserNotice:, ExplicitText:
 
* X509v3 Basic Constraints: (critical)
*   CA:TRUE
* Authority Information Access: 
*   OCSP-URI:http://ocsp.digicert.com
* X509v3 CRL Distribution Points: 
*   , FullName:, URI:http://crl3.digicert.com/DigiCertHighAssuranceEVRootCA.crl, 
FullName:, URI:http://crl4.digicert.com/DigiCertHighAssuranceEVRootCA.crl
* X509v3 Authority Key Identifier: 
*   keyid:B1:3E:C3:69:03:F8:BF:47:01:D4:98:26:1A:08:02:EF:63:64:2B:C3
* X509v3 Subject Key Identifier: 
*   50:EA:73:89:DB:29:FB:10:8F:9E:E5:01:20:D4:DE:79:99:48:83:F7
*  Signature: 5d:4f:84:f1:a8:88:d3:a3:b2:bc:9c:6d:e5:29:49:77:e1:e7:d6:dc:a9:d8:35:ae:c9:71:dc:e5:db:dc:9d:24:21:90:a6:cf:b7:01:1c:9b:d4:57:97:91:d7:75:16:a5:12:d7:b9:3d:2e:89:3d:39:69:8a:d6:35:37:f9:f1:21:c4:5b:40:ad:59:a9:2f:5f:3a:00:29:43:27:71:03:e4:bd:30:32:55:a6:fe:84:0e:0b:9b:38:19:2c:43:7c:ac:43:bf:75:31:e5:23:1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cnQu
Y29tL0RpZ2lDZXJ0SGlnaEFzc3VyYW5jZUVWUm9vdENBLmNybDAfBgNVHSMEGDAW
gBSxPsNpA/i/RwHUmCYaCALvY2QrwzAdBgNVHQ4EFgQUUOpzidsp+xCPnuUBINTe
eZlIg/cwDQYJKoZIhvcNAQEFBQADggEBAF1PhPGoiNOjsrycbeUpSXfh59bcqdg1
rslx3OXb3J0kIZCmz7cBHJvUV5eR13UWpRLXuT0uiT05aYrWNTf58SHEW0CtWakv
XzoAKUMncQPkvTAyVab+hA4LmzgZLEN8rEO/dTHlIxxFVbdpCJG1z9fVsV7un5Tk
1nq5G*  2 Subject: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert High Assurance EV Root CA
*    Issuer: C=US; O=Entrust.net; OU=www.entrust.net/CPS incorp. by ref. (limits liab.); OU=(c) 1999 Entrust.net Limited; CN=Entrust.net Secure Server Certification Authority
*    Version: 3 (0x2)
*    Serial Number: 1116160165 (0x428740a5)
*    Signature Algorithm: sha1WithRSAEncryption
*    Start date: 2006-10-01 05:00:00 GMT
*    Expire date: 2014-07-26 18:15:15 GMT
*    Public Key Algorithm: rsaEncryption
*    RSA Public Key (2048 bits)
*    rsa(n): c6:cc:e5:73:e6:fb:d4:bb:e5:2d:2d:32:a6:df:e5:81:3f:c9:cd:25:49:b6:71:2a:c3:d5:94:34:67:a2:0a:1c:b0:5f:69:a6:40:b1:c4:b7:b2:8f:d0:98:a4:a9:41:59:3a:d3:dc:94:d6:3c:db:74:38:a4:4a:cc:4d:25:82:f7:4a:a5:53:12:38:ee:f3:49:6d:71:91:7e:63:b6:ab:a6:5f:c3:a4:84:f8:4f:62:51:be:f8:c5:ec:db:38:92:e3:06:e5:08:91:0c:c4:28:41:55:fb:cb:5a:89:15:7e:71:e8:35:bf:4d:72:09:3d:be:3a:38:50:5b:77:31:1b:8d:b3:c7:24:45:9a:a7:ac:6d:00:14:5a:04:b7:ba:13:eb:51:0a:98:41:41:22:4e:65:61:87:81:41:50:a6:79:5c:89:de:19:4a:57:d5:2e:e6:5d:1c:53:2c:7e:98:cd:1a:06:16:a4:68:73:d0:34:04:13:5c:a1:71:d3:5a:7c:55:db:5e:64:e1:37:87:30:56:04:e5:11:b4:29:80:12:f1:79:39:88:a2:02:11:7c:27:66:b7:88:b7:78:f2:ca:0a:a8:38:ab:0a:64:c2:bf:66:5d:95:84:c1:a1:25:1e:87:5d:1a:50:0b:20:12:cc:41:bb:6e:0b:51:38:b8:4b:cb:
*    rsa(e): 01:00:01:
* X509v3 Basic Constraints: (critical)
*   CA:TRUE,pathlen:1
* X509v3 Extended Key Usage: 
*   TLSWebServerAuthentication,TLSWebClientAuthentication,E-mailProtection
* Authority Information Access: 
*   OCSP-URI:http://ocsp.entrust.net
* X509v3 CRL Distribution Points: 
*   , FullName:, URI:http://crl.entrust.net/server1.crl
* X509v3 Subject Key Identifier: 
*   B1:3E:C3:69:03:F8:BF:47:01:D4:98:26:1A:08:02:EF:63:64:2B:C3
* X509v3 Key Usage: 
*   CertificateSign,CRLSign
* X509v3 Authority Key Identifier: 
*   keyid:F0:17:62:13:55:3D:B3:FF:0A:00:6B:FB:50:84:97:F3:ED:62:D0:1A
* 1.2.840.113533.7.65.0: 
*   0, ..V7.1....
*  Signature: 48:0e:2b:6f:20:62:4c:28:93:a3:24:3d:58:ab:21:cf:80:f8:9a:97:90:6a:22:ed:5a:7c:47:36:99:e7:79:84:75:ab:24:8f:92:0a:d5:61:04:ae:c3:6a:5c:b2:cc:d9:e4:44:87:6f:db:8f:38:62:f7:44:36:9d:ba:bc:6e:07:c4:d4:8d:e8:1f:d1:0b:60:a3:b5:9c:ce:63:be:ed:67:dc:f8:ba:de:6e:c9:25:cb:5b:b5:9d:76:70:0b:df:42:72:f8:4f:41:11:64:a5:d2:ea:fc:d5:af:11:f4:15:38:67:9c:20:a8:4b:77:5a:91:32:42:32:e7:85:b3:df:36:
* -----BEGIN CERTIFICATE-----
MIIEQjCCA6ugAwIBAgIEQodApTANBgkqhkiG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iJodHRwOi8v
Y3JsLmVudHJ1c3QubmV0L3NlcnZlcjEuY3JsMB0GA1UdDgQWBBSxPsNpA/i/RwHU
mCYaCALvY2QrwzALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8BdiE1U9s/8KAGv7
UISX8+1i0BowGQYJKoZIhvZ9B0EABAwwChsEVjcuMQMCAIEwDQYJKoZIhvcNAQEF
BQADgYEASA4rbyBiTCiToyQ9WKshz4D4mpeQaiLtWnxHNpnneYR1qySPkgrVYQSu
w2pcsszZ5ESHb9uPOGL3RDadurxuB8TUjegf0Qtgo7WczmO+7Wfc+Lrebskly1u1
nXZwC99CcvhPQRFkpdLq/NWvEfQVOGecIKhLd1qRMkIy54Wz3zY=
-----END CERTIFICATE-----
 
* Server certificate:
*      subject: C=AU; ST=NSW; L=Sydney; O=ATLASSIAN PTY LTD; OU=IT; CN=*.atlassian.com
*      start date: 2011-01-04 00:00:00 GMT
*      expire date: 2014-01-27 23:59:59 GMT
*      subjectAltName: my.atlassian.com matched
*      issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert High Assurance CA-3
*      SSL certificate verify ok.
> HEAD /login HTTP/1.1
Host: my.atlassian.com
Accept: */*
 
< HTTP/1.1 200 OK
< Date: Sat, 06 Oct 2012 05:02:28 GMT
< Set-Cookie: JSESSIONID=5B4B5F2F5F21C9541FD54A638F5906F2; Path=/; Secure; HttpOnly
< Content-Type: text/html;charset=utf-8
< Content-Language: en-US
< Content-Length: 8192
< Vary: Accept-Encoding
< 
* Connection #0 to host my.atlassian.com left intact
* Closing connection #0

Slava on 2014-06-23 07:59:35
It only works when you remove CURLOPT_SSLVERSION.