I was looking for a PHP script which checks if the script can connect to the http port.
I tried codes like this, but the response of https and http is the same:
<?php
$get = stream_context_create(array("ssl" => array("capture_peer_cert" => TRUE)));
$read = stream_socket_client("ssl://www.raffelpages.com:443", $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $get);
$cert = stream_context_get_params($read);
var_dump($cert["options"]["ssl"]["peer_certificate"]);