Skip to content

Instantly share code, notes, and snippets.

@ju5t
Last active March 14, 2019 19:03
Show Gist options
  • Select an option

  • Save ju5t/e84f7ca83d3e0adc97134ca05ec1c4ca to your computer and use it in GitHub Desktop.

Select an option

Save ju5t/e84f7ca83d3e0adc97134ca05ec1c4ca to your computer and use it in GitHub Desktop.

Revisions

  1. ju5t revised this gist Mar 14, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion whmcs-test-ssl.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    #!/bin/bash
    #!/usr/bin/env bash
    yum install -y php
    cat <<\PHP > test.php
    <?php
  2. ju5t created this gist Mar 14, 2019.
    26 changes: 26 additions & 0 deletions whmcs-test-ssl.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    #!/bin/bash
    yum install -y php
    cat <<\PHP > test.php
    <?php
    $domain = 'www.whmcs.com';
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'https://' . $domain);
    curl_setopt($ch, CURLOPT_CERTINFO, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_NOBODY, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
    curl_setopt($ch, CURLOPT_TIMEOUT, 10);
    curl_setopt($ch, CURLOPT_VERBOSE, true);
    if(curl_exec($ch) === false){
    echo 'Curl error: ' . curl_error($ch);
    }
    $certInfo = curl_getinfo($ch, CURLINFO_CERTINFO);
    print_r($certInfo);
    ?>
    PHP

    php -q test.php