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

Unable to connect to "<MY_URL>": 35 SSL connect error #230

Open
deniscsz opened this issue Jun 19, 2016 · 1 comment
Open

Unable to connect to "<MY_URL>": 35 SSL connect error #230

deniscsz opened this issue Jun 19, 2016 · 1 comment

Comments

@deniscsz
Copy link

deniscsz commented Jun 19, 2016

Code used to send a post:

// ...
$request = json_encode($sale);
try {
    $response = \Httpful\Request::post($uri)
        ->sendsJson()
        ->addHeaders($this->headers)
        ->body($request)            
        ->send();
}
catch (Exception $e) {
    // ...
}

But I got a exception:

exception 'Httpful\Exception\ConnectionErrorException' with message 'Unable to connect to "https://apisandbox.braspag.com.br/v2/sales": 35 SSL connect error' in

I tried withStrictSSL and withoutStrictSSL but I got the same result.

So I decided to test with cURL to check how to connect and I got these results:

$ curl --sslv2 https://apisandbox.braspag.com.br/v2/sales
curl: (35) SSL connect error

Ssl2 doesn't work

$ curl --sslv3 https://apisandbox.braspag.com.br/v2/sales
curl: (35) SSL connect error

Ssl3 doesn't work too

$ curl --tlsv1 https://apisandbox.braspag.com.br/v2/sales
{"Message":"The requested resource does not support http method 'GET'."}

Here we are, I need use tls to connect.

So, how can I force httpful use TLS to send a post to secure url?
I edited Request.php and added curl_setopt($ch, CURLOPT_SSLVERSION, 5); but it isn't a goot way. I did not find any function I could use in this case. It does not really exist?

@oha3
Copy link

oha3 commented Nov 28, 2017

Hi deniscsz,

I have the same issue. Did you solve this problem at this time?

thx

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

2 participants