HostOnNet Blog

PHP Script to verify TLS 1.2

Looking for Linux Server Admin or WordPress Expert? We can help.

Many payment providers recently moved to more secure SSL protocol TLS 1.2.

Many of these providers will sent you mail asking you to make sure your web server support TLS 1.2

Checklist: Preparing for the system upgrade to TLS 1.2

If your website is hosted, check with your hosting provider if they support TLS 1.2.
If you host your own website, check if your system already supports TLS 1.2.
If you or your hosted environment do not support TLS 1.2, arrange/request an upgrade.
Code your system to always use the highest version of TLS available; avoid hardcoding versions.

Here is a PHP Scrip that can verify if your web server can support TLS 1.2



$ch = curl_init('');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($ch);

$json = json_decode($data);
echo $json->tls_version;
echo "\n";

Upload it to your web site and access it. If you see 1.2, your will be fine.

$ php tls_version.php 
TLS 1.2

Posted in PHP

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.