Skip to content

Instantly share code, notes, and snippets.

@hn-support
Last active May 3, 2017 13:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hn-support/a446afc36363d8d997370398612f4690 to your computer and use it in GitHub Desktop.
Save hn-support/a446afc36363d8d997370398612f4690 to your computer and use it in GitHub Desktop.
Verify curl ssl connections with php
<?php
/*
This script tests whether your php installation is able to create TLS connections.
*/
foreach ([6, 7, 8] as $version) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://tlstest.paypal.com/");
curl_setopt($ch, CURLOPT_SSLVERSION, $version);
var_dump(curl_exec($ch));
var_dump(curl_error($ch));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment