Skip to content

Instantly share code, notes, and snippets.

@imroca
Created May 18, 2017 14:27
Show Gist options
  • Save imroca/1f53c273da0cd067157d732e9d20f962 to your computer and use it in GitHub Desktop.
Save imroca/1f53c273da0cd067157d732e9d20f962 to your computer and use it in GitHub Desktop.
Check for TLS 1..2
<?php
$curl_info = curl_version();
echo "CURL Info\n";
print_r($curl_info);
$ch = curl_init('https://www.howsmyssl.com/a/check');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($ch);
curl_close($ch);
$json = json_decode($data);
echo "\n~~~~~~~~~~\n";
print_r($json);
echo "\n~~~~~~~~~~\n";
echo "Your TLS version is:" . $json->tls_version;
echo "\n~~~~~~~~~~\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment