imbo / behat-api-extension

API extension for Behat, used to ease testing of JSON-based APIs
MIT License
108 stars 42 forks source link

Added guzzle Verify SSL option for local development #66

Closed vitalyiegorov closed 6 years ago

vitalyiegorov commented 6 years ago

Usually for local development you create self signed SSL certificates, this PR resolves guzzle/curl error:

cURL error 60: SSL certificate problem: self signed certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) (GuzzleHttp\Exception\RequestException)
vitalyiegorov commented 6 years ago

@christeredvartsen Closes #65

christeredvartsen commented 6 years ago

Would it be better to just forward whatever is set in the apiClient part of the extension configuration to the Guzzle constructor, instead of specifying specific options?

You could then configure the Behat extension like this:

default:
    extensions:
        Imbo\BehatApiExtension:
            apiClient:
                base_uri: https://some.uri
                verify: false
                headers: 
                    x-some-header: value
vitalyiegorov commented 6 years ago

@christeredvartsen Updated PR and tests to pass whole array from

apiClient:
   ...

to Guzzle client initialization

vitalyiegorov commented 6 years ago

@christeredvartsen Can we merge this PR?

christeredvartsen commented 6 years ago

Can we merge this PR?

Hold your :horse: there cowboy. I'll have a look at the code changes after work.

vitalyiegorov commented 6 years ago

@christeredvartsen Howdy Sheriff, have you had a chance to check it?

christeredvartsen commented 6 years ago

Superseded by #67.