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

Migrating Gateway to v3 - how to set http timeout and enforcing TLS1.2 #195

Open
funkflute opened this issue Jul 31, 2018 · 1 comment
Open

Comments

@funkflute
Copy link

So the new default PSR-7 interface doesn't seem to allow options I was using when were using Guzzle:

CURLOPT_SSLVERSION     => CURL_SSLVERSION_TLSv1_2,
CURLOPT_CONNECTTIMEOUT => 10,

So should I be requiring guzzle and implementing it in my gateway? (how would I register it as the default $this->httpClient?) Or is there another preferred way to get these types of options I'm not seeing?

Also is there a way to disable the "MockClient" during PhpUnit Testing and use the real HttpClient? This is so I can test that the actual HTTP connection process is getting data back as it should.

@judgej
Copy link
Member

judgej commented Aug 1, 2018

Had the same problem myself the other day. I wanted to switch on Guzzle debug, but httplug does not provide a way to add options, the reasoning being that options vary so much between different HTTP implementations.

I think the way to do this is to create an extended Guzzle client, with your own injected options, and register that with httplug. I only got as far as the concept and could not find any decent examples to follow. When it is worked out, I think a package containing the extension will be useful. I'm not sure that a Omnipay driver could ever add its own options, since it does not know what implementation is being used, but perhaps a separate package could contain enough specific logic to know how to pass some common options to most popular HTTP client implementations at least.

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