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

CURL ERROR: SSL connect error #371

Open
rschum opened this issue May 10, 2019 · 2 comments
Open

CURL ERROR: SSL connect error #371

rschum opened this issue May 10, 2019 · 2 comments

Comments

@rschum
Copy link

rschum commented May 10, 2019

I have verified my sandbox credentials and I have also used API live console to successfully execute an Auth only test transaction using https://developer.authorize.net/api/reference/index.html#payment-transactions-authorize-a-credit-card

However, when I use the php sample code (https://github.com/AuthorizeNet/sample-code-php/blob/master/PaymentTransactions/authorize-credit-card.php)
with my API Login ID and transaction key hard coded into the sample, I'm only ever getting "No response returned"

The endpoint specified by \net\authorize\api\constants\ANetEnvironment::SANDBOX is https://apitest.authorize.net

Any ideas about what's going wrong?

@rschum
Copy link
Author

rschum commented May 22, 2019

I switched to using the "hello world" test script ( following these instructions: https://developer.authorize.net/hello_world/ ) and found that the same problem was occurring. In "phplog" file I found this error recorded:
[_sendRequest] (****/vendor/authorizenet/authorizenet/lib/net/authorize/util/HttpClient.php : 107) - CURL ERROR: SSL connect error

I inserted this code below line 73 in HttpClient.php:
curl_setopt($curl_request, CURLOPT_SSLVERSION, 6);
That line was necessary to make the test scripts work.
See https://www.php.net/manual/en/function.curl-setopt.php about CURLOPT_SSLVERSION for more info.

Additionally, I updated vendor/authorizenet/authorizenet/lib/ssl/cert.pm with the CA root certificate bundle provided here: https://github.com/activemerchant/active_merchant/blob/master/lib/certs/cacert.pem

@rschum rschum changed the title no reply on sample code no reply on sample code: ERROR: SSL connect error May 22, 2019
@rschum rschum changed the title no reply on sample code: ERROR: SSL connect error ERROR: SSL connect error May 22, 2019
@rschum rschum changed the title ERROR: SSL connect error CURL ERROR: SSL connect error May 22, 2019
@BenjaminInUt
Copy link

I believe you just need to update the cert.pem file found in the "ssl" folder. If you google the error, this is a common CURL issue. I believe the one you need is here (yes, I'm aware how the URL looks, I thought the same thing): https://curl.haxx.se/docs/caextract.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants