Skip to content

Instantly share code, notes, and snippets.

@caasig
Forked from olivierbellone/tls_test.php
Created April 19, 2018 04:15
Show Gist options
  • Save caasig/70ff56c636b5a81439bff028ca051ac7 to your computer and use it in GitHub Desktop.
Save caasig/70ff56c636b5a81439bff028ca051ac7 to your computer and use it in GitHub Desktop.
Simple TLS version test for PHP, using howsmyssl.com
<?php
$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 "<pre>TLS version: " . $json->tls_version . "</pre>\n";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment