Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy CONNECT aborted #269

Open
akramfares opened this issue Apr 10, 2018 · 0 comments
Open

Proxy CONNECT aborted #269

akramfares opened this issue Apr 10, 2018 · 0 comments

Comments

@akramfares
Copy link

Hello,

I'm trying to send a simple POST request:
$client->request("POST", $payload(), $uri, "application/json", 3);

But I get this error:

Proxy CONNECT aborted

I'm using docker (with proxy), and after debugging, I found out that Httpful is adding Content-Length to the header which is causing this issue:

// vendor/nategood/httpful/src/Httpful/Request.php in line 898
// set Content-Length to the size of the payload if present
        if (isset($this->payload)) {
            curl_setopt($ch, CURLOPT_POSTFIELDS, $this->serialized_payload);
            if (!$this->isUpload()) {
                $this->headers['Content-Length'] =
                    $this->_determineLength($this->serialized_payload);
            }
        }

The complete debug log when running curl:

* Hostname was NOT found in DNS cache
*   Trying xx.xx.xx.xx...
* Connected to proxy..com (xx.xx.xx.xx) port 8080 (#0)
* Establish HTTP proxy tunnel to website.com:443
* Proxy auth using Basic with user 'user'
* Server auth using Basic with user 'user2'
> CONNECT website.com:443 HTTP/1.1
> Host: website.com:443
> Proxy-Authorization: Basic hash
> User-Agent: curl
> Proxy-Connection: Keep-Alive
> Accept: application/json; version=3
> Content-Type: application/json
> Content-Length: 123
>
* Proxy CONNECT aborted
* Connection #0 to host proxy.com left intact
curl: (56) Proxy CONNECT aborted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant