smart_str soap_headers = {0};
/* Set peer_name or name verification will try to use the proxy server name */
- if (context && (tmp = php_stream_context_get_option(context, "ssl", "peer_name")) != NULL) {
+ if (!context || (tmp = php_stream_context_get_option(context, "ssl", "peer_name")) == NULL) {
ZVAL_STRING(&ssl_proxy_peer_name, phpurl->host);
php_stream_context_set_option(PHP_STREAM_CONTEXT(stream), "ssl", "peer_name", &ssl_proxy_peer_name);
zval_ptr_dtor(&ssl_proxy_peer_name);
if (!getenv('http_proxy')) { die("skip test unless an HTTP/HTTPS proxy server is specified in http_proxy environment variable"); }
?>
--INI--
-soap.wsdl_cache_enabled=0
+soap.wsdl_cache_enabled=1
--FILE--
<?php
list ($proxyHost, $proxyPort) = explode(':', str_replace('http://', '', $_ENV['http_proxy']));
+// Prime the WSDL cache because that request sets peer_name on the HTTP context
+// and masks the SOAP bug.
$testServiceWsdl = 'https://ws.cdyne.com/ip2geo/ip2geo.asmx?wsdl';
+$client = new SoapClient($testServiceWsdl);
+unset($client);
+
$parameters = [
'proxy_host' => $proxyHost,
'proxy_port' => $proxyPort,