-
-
Save rmccue/64e6a89e900cbe33d7eb to your computer and use it in GitHub Desktop.
Test SSL with a self-signed certificate on OSX: https://core.trac.wordpress.org/ticket/34794
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url = 'https://self-signed.badssl.com/'; | |
$handle = curl_init( $url ); | |
curl_setopt( $handle, CURLOPT_SSL_VERIFYPEER, false ); | |
curl_setopt( $handle, CURLOPT_SSL_VERIFYHOST, false ); | |
curl_setopt( $handle, CURLOPT_RETURNTRANSFER, true ); | |
curl_setopt( $handle, CURLOPT_HEADER, false ); | |
$headers = curl_exec( $handle ); | |
if ( $err = curl_errno( $handle ) ) { | |
printf( 'Error [%d]: %s' . PHP_EOL, $err, curl_error( $handle ) ); | |
} else { | |
echo 'Success!' . PHP_EOL; | |
var_dump( $headers ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment