How to check if your PHP support TLS V1.2?

How to check if your PHP support TLS V1.2?

Run this script to see your SSL Version

<?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 $json->tls_version;
?>

 

If you want to check your open SSL version?

<?php    
$curl_info = curl_version();
echo $curl_info['ssl_version'];
?>

OpenSSL 1.0.1 and later supportĀ  TLS v1.1 and TLS v1.2

If you see your OpenSSL version from 1.0.1, then it will support TLS V1.1 and TLS V1.2

Leave a Reply

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