check website ssl certificate using php

Solutions on MaxInterview for check website ssl certificate using php by the best coders in the world

showing results for - "check website ssl certificate using php"
Salomé
25 May 2016
1$ip = gethostbyname($domain);
2$url = "http://" . $domain;
3$orignal_parse = parse_url($url, PHP_URL_HOST);
4$get = stream_context_create(array("ssl" => array("capture_peer_cert" => TRUE)));
5$read = stream_socket_client("ssl://" . $orignal_parse . ":443", $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $get);
6$cert = stream_context_get_params($read);
7$result = (!is_null($cert)) ? true : false;