Last active
March 14, 2019 19:03
-
-
Save ju5t/e84f7ca83d3e0adc97134ca05ec1c4ca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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