note 117135 added to soapclient.soapclient
| From: | infoatnospamxvalitonxcom | Date: | Mon, 20 Apr 2015 13:00:47 +0000 |
| Subject: | note 117135 added to soapclient.soapclient | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-202304@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/soapclient.soapclient.php
Edit -- https://master.php.net/note/edit/117135
Del: integrated -- https://master.php.net/note/delete/117135/integrated
Del: useless -- https://master.php.net/note/delete/117135/useless
Del: bad code -- https://master.php.net/note/delete/117135/bad+code
Del: spam -- https://master.php.net/note/delete/117135/spam
Del: non-english -- https://master.php.net/note/delete/117135/non-english
Del: in docs -- https://master.php.net/note/delete/117135/in+docs
Del: other reasons-- https://master.php.net/note/delete/117135
Reject -- https://master.php.net/note/reject/117135
Search -- https://master.php.net/manage/user-notes.php