note 117083 added to class.soapclient
| From: | infoatnospamxvalitonxcom | Date: | Mon, 13 Apr 2015 08:06:30 +0000 |
| Subject: | note 117083 added to class.soapclient | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-202244@lists.php.net to get a copy of this message | ||
CAUTION:
I had quite a bit of trouble trying to make a request with fopen through a proxy to a secure url. I
kept getting a 400 Bad Request back from the remote host. It was receiving the proxy url as the SNI
host. In order to get around this I had to explicity set the SNI host to the domain I was trying to
reach. It's apparently the issue outlined in this bug:
https://bugs.php.net/bug.php?id=63519
<?php
$domain = parse_url($file, PHP_URL_HOST);
$proxy_string = "tcp://" . WP_PROXY_HOST . ":" . WP_PROXY_PORT;
$opts = array(
'http' => array( 'proxy' => $proxy_string ),
'ssl' => array( 'SNI_enabled' => true, 'SNI_server_name'
=> $domain));
$context = stream_context_create($opts);
$handle = fopen( $file, 'r', false, $context );
?>
src:
http://php.net/manual/en/context.http.php#114314
----
Server IP: 72.52.91.14
Probable Submitter: 193.26.96.1
----
Manual Page -- http://php.net/manual/en/class.soapclient.php
Edit -- https://master.php.net/note/edit/117083
Del: integrated -- https://master.php.net/note/delete/117083/integrated
Del: useless -- https://master.php.net/note/delete/117083/useless
Del: bad code -- https://master.php.net/note/delete/117083/bad+code
Del: spam -- https://master.php.net/note/delete/117083/spam
Del: non-english -- https://master.php.net/note/delete/117083/non-english
Del: in docs -- https://master.php.net/note/delete/117083/in+docs
Del: other reasons-- https://master.php.net/note/delete/117083
Reject -- https://master.php.net/note/reject/117083
Search -- https://master.php.net/manage/user-notes.php