Skip to content

Instantly share code, notes, and snippets.

@ju5t
Last active March 14, 2019 19:03
Show Gist options
  • Save ju5t/e84f7ca83d3e0adc97134ca05ec1c4ca to your computer and use it in GitHub Desktop.
Save ju5t/e84f7ca83d3e0adc97134ca05ec1c4ca to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
yum install -y php
cat <<\PHP > test.php
<?php
$domain = 'www.whmcs.com';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://' . $domain);
curl_setopt($ch, CURLOPT_CERTINFO, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_NOBODY, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_VERBOSE, true);
if(curl_exec($ch) === false){
echo 'Curl error: ' . curl_error($ch);
}
$certInfo = curl_getinfo($ch, CURLINFO_CERTINFO);
print_r($certInfo);
?>
PHP
php -q test.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment