Skip to content

Instantly share code, notes, and snippets.

@summercms
Forked from olivierbellone/tls_test.php
Created May 22, 2022 17:37
Show Gist options
  • Select an option

  • Save summercms/32a022d3530e61b947fbaf1f697315cd to your computer and use it in GitHub Desktop.

Select an option

Save summercms/32a022d3530e61b947fbaf1f697315cd 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