Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Programming»PHP»How to Test TLS version used for PHP

    How to Test TLS version used for PHP

    RahulBy RahulAugust 7, 20191 Min ReadUpdated:September 5, 2019

    The howsmyssl.com website provides you the option to test TLS version used by your browser or PHP script. Put the below PHP script on your website document root and access in a web browser. This will return the TLS version used by your script to connect remote application.

    1
    2
    3
    4
    5
    6
    7
    8
    <?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 "<h1>Your TLS version is: " . $json->tls_version . "</h1>\n";
    ?>

    I have written this in a tls_test.php script and then accessed in a web browser. The result shows the PHP is using TLS 1.2. If your application is using lower version by default, then you can force PHP to use TLS 1.2 with cURL using this tutorial.

    Test PHP TLS Version

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Install Angular CLI on macOS
    Next Article How to Force Use TLS 1.2 with cURL PHP

    Related Posts

    How To Install PHP (8.1, 7.4 or 5.6) on Ubuntu 22.04

    Updated:June 19, 20223 Mins Read

    How To Install Linux, Nginx, MySQL, & PHP (LEMP Stack) on Ubuntu 22.04

    Updated:April 7, 20227 Mins Read

    How To Install and Use PHP Composer on Debian 11

    Updated:February 16, 20224 Mins Read

    How To Install PHP (8.1, 7.4 & 5.6) on Debian 11

    Updated:February 16, 20224 Mins Read

    How to Install PHP 8 on CentOS/RHEL 8

    3 Mins Read

    How to Install PHP 8 on Ubuntu 20.04

    Updated:September 12, 20214 Mins Read

    1 Comment

    1. bgheimat on September 18, 2019 5:18 pm

      Many thanks for your info sharing.

      Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • How To Install Docker on Ubuntu 22.04
    • How to Install Bower on Ubuntu 22.04 & 20.04
    • How to run “npm start” through Docker
    • Filesystem Hierarchy Structure (FHS) in Linux
    • How to accept user input in Python
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.