Codeception local testing with self-signed certificate

Viewed 88

I would like to write the codeceptions tests locally. Unfortunately the self-signed certificate is not accepted.

[GuzzleHttp\Exception\ConnectException] cURL error 7: Failed to connect to https://api.example.local port 443: Connection refused (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://api.example.local/route

I have found the following information after my research, but it does not work.

I think that codeception does not take over the configuration. That would also be the curl options.

modules:
  enabled:
    - REST:
        depends: PhpBrowser
        url: &url 'https://api.example.local'
    - Helper\ApiHelper
  config:
    PhpBrowser:
      url: *url
      verify: false
      curl:
        CURLOPT_SSL_VERIFYHOST: 0
        CURLOPT_SSL_VERIFYPEER: 0
      headers:
        Content-Type: application/json
        X-AUTH-TOKEN: "xxxxxxxxxxxxxxxxxxxxx"

Thanks for the support.

0 Answers
Related