Skip to content

Instantly share code, notes, and snippets.

@silv3rm00n
Created April 2, 2012 12:58
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 silv3rm00n/2283275 to your computer and use it in GitHub Desktop.
Save silv3rm00n/2283275 to your computer and use it in GitHub Desktop.
this works :
$ curl -k --cert mag.pem:abcd https://something
php code does not work :
<?php
$url = "https://something";
// Create a stream
$opts = array(
'ssl' => array(
'local_cert' => 'mag.pem' ,
'passphrase' => 'abcd' ,
) ,
);
$context = stream_context_create($opts);
$content = file_get_contents( $url , false, $context);
echo $content;
it says :
HTTP Error 403.7 - Forbidden: SSL client certificate is required.<br>Internet Information Services (IIS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment