Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

check website ssl certificate using php

$ip = gethostbyname($domain);
$url = "http://" . $domain;
$orignal_parse = parse_url($url, PHP_URL_HOST);
$get = stream_context_create(array("ssl" => array("capture_peer_cert" => TRUE)));
$read = stream_socket_client("ssl://" . $orignal_parse . ":443", $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $get);
$cert = stream_context_get_params($read);
$result = (!is_null($cert)) ? true : false;
 
PREVIOUS NEXT
Tagged: #check #website #ssl #certificate #php
ADD COMMENT
Topic
Name
2+8 =