Created
February 22, 2017 18:00
-
-
Save rogersguedes/6b2c459d49acd83133677cd00232ac4d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $target = "www.google.com"; | |
| $g = stream_context_create (array("ssl" => array("capture_peer_cert" => true))); | |
| $r = stream_socket_client(sprintf("ssl://%s:443", $target), $errno, $errstr, 30, | |
| STREAM_CLIENT_CONNECT, $g); | |
| $cont = stream_context_get_params($r); | |
| var_dump(openssl_x509_parse($cont["options"]["ssl"]["peer_certificate"])); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment