Skip to content

Instantly share code, notes, and snippets.

@huglester
Created July 4, 2016 20:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save huglester/15cc3a8057b11561ea80a5c3671a019b to your computer and use it in GitHub Desktop.
Save huglester/15cc3a8057b11561ea80a5c3671a019b to your computer and use it in GitHub Desktop.
SSL verify
<?php
$g = stream_context_create (array("ssl" => array("capture_peer_cert" => true)));
$r = stream_socket_client("tls://www.google.com:8080", $errno, $errstr, 30,
STREAM_CLIENT_CONNECT, $g);
$cont = stream_context_get_params($r);
var_dump($cont["options"]["ssl"]["peer_certificate"]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment