Revert "Properly support certificate validation if a HTTP proxy is used"
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 18 Dec 2014 21:44:36 +0000 (22:44 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 18 Dec 2014 21:44:54 +0000 (22:44 +0100)
This reverts commit c79b8fcb3e9db22ac5b4c558a8ed7a3d68f3eb80.

wcfsetup/install/files/lib/system/io/RemoteFile.class.php
wcfsetup/install/files/lib/util/HTTPRequest.class.php

index ba17cb01d5f45ddc5e9d998493ea1cf1ffebf523..da47f6a84321440e504e625d6e37948f0fffae98 100644 (file)
@@ -51,14 +51,11 @@ class RemoteFile extends File {
         * @param       integer         $timeout
         * @param       array           $options
         */
-       public function __construct($host, $port, $timeout = 30, $options = array()) {
+       public function __construct($host, $port, $timeout = 30) {
                $this->host = $host;
                $this->port = $port;
                
-               if (!preg_match('/^[a-z0-9]+:/', $this->host)) $this->host = 'tcp://'.$this->host;
-               
-               $context = stream_context_create($options);
-               $this->resource = @stream_socket_client($this->host.':'.$this->port, $this->errorNumber, $this->errorDesc, $timeout, STREAM_CLIENT_CONNECT, $context);
+               $this->resource = @fsockopen($host, $port, $this->errorNumber, $this->errorDesc, $timeout);
                if ($this->resource === false) {
                        throw new SystemException('Can not connect to ' . $host, 0, $this->errorDesc);
                }
index 2c55563d84b24c78877341961e4a0101eab2875f..867eb942bd7819b34717bab9ec78935c2e220ab6 100644 (file)
@@ -249,11 +249,7 @@ final class HTTPRequest {
         */
        public function execute() {
                // connect
-               $remoteFile = new RemoteFile(($this->useSSL ? 'ssl://' : '').$this->host, $this->port, $this->options['timeout'], array(
-                       'ssl' => array(
-                               'peer_name' => $this->originHost
-                       )
-               ));
+               $remoteFile = new RemoteFile(($this->useSSL ? 'ssl://' : '').$this->host, $this->port, $this->options['timeout']);
                
                if ($this->originUseSSL && PROXY_SERVER_HTTP) {
                        if ($this->useSSL) throw new SystemException("Unable to proxy HTTPS when using TLS for proxy connection");