helmutschneider / swish-php

PHP-wrapper for the Swish merchant api
MIT License
40 stars 19 forks source link

need workaround for host without openssl #10

Closed elr0berto closed 5 years ago

elr0berto commented 5 years ago

SSL Version = NSS/3.27.1

Any workaround / idea on how to make it work with this? I could make a pull request with an auto-detection / setting for this as a way to give back if you can give some hint on how to make it work...

right now its giving "CURL error 35: SSL connect error"

Any help much appriciated.

helmutschneider commented 5 years ago

Please provide the complete stack trace. SSL errors are generally quite vague and can occur due to a multitude of reasons.

However, lately I have noticed that some SSL libraries are still trying (in 2018) to connect with SSLv3 instead of TLS. With OpenSSL it is possible to force a specific version to be used but I am not sure about NSS.

elr0berto commented 5 years ago

The support at unoeuro solved the issue by adding a handler..

$handler = new GuzzleHttp\Handler\StreamHandler; // this $client = Client::make($rootCert, $clientCert, Client::SWISH_PRODUCTION_URL, $handler / and this /);

that's all it took .. now it works! I guess NSS is compatible with openssl in this regard ... not sure why this works, but it does.

helmutschneider commented 5 years ago

Interesting. StreamHandler is built around the stream_* functions instead of cURL which is the default.

elr0berto commented 5 years ago

I see... so that's why it works. Maybe it can be put in the README of swish-php as an alternative for those with curl-problems