Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

No method is configured to handle the ssl.certificate_authority config key (InvalidArgumentException) #165

Closed
j4m3s opened this issue Sep 12, 2014 · 7 comments

Comments

@j4m3s
Copy link

j4m3s commented Sep 12, 2014

Has the mechanism for configuring goutte to ignore ssl cert errors changed? After update from stable to dev-master (using composer) I'm now seeing the following error:
No method is configured to handle the ssl.certificate_authority config key (InvalidArgumentException)

behat.yml matches the docs in the repo:

    extensions:
        Behat\MinkExtension:
            sessions: 
                defaultHeadless: 
                    goutte:
                        guzzle_parameters:
                            ssl.certificate_authority: false

If I remove the ssl config setting altogether the tests won't run due to the curl ssl cert problem.

Thanks.

@stof
Copy link
Member

stof commented Sep 12, 2014

can you paste the stack trace of the exception (run Behat in verbose mode to get it) ?

@j4m3s
Copy link
Author

j4m3s commented Sep 12, 2014

Sorry @stof I'm struggling to get you the stacktrace. I'm running bin/behat -v but getting the following error (printed just after the first step definition is output):

  No method is configured to handle the ssl.certificate_authority config key (InvalidArgumentException)
│
╳  Unable to access the response before visiting a page (Behat\Mink\Exception\DriverException)
│
└─ @AfterStep # FeatureContext::takeScreenshotAfterFailedStep()

My composer.json is as follows (I'm getting an " Unreachable field "Edit" (Behat\Mink\Exception\ElementException)" exception since migrating to behat 3 so am running the master branches to check if it's resolved but not released):

{
    "require-dev": {
        "behat/behat": "3.*",
        "behat/mink": "dev-master",
        "behat/mink-extension": "dev-master",
        "sensiolabs/behat-page-object-extension": "@dev",
        "behat/mink-goutte-driver": "dev-master",
        "behat/mink-browserkit-driver": "@dev",
        "behat/mink-selenium2-driver": "dev-master",
        "phpunit/phpunit": "*"
    },
    "prefer-stable": true,
    "config": {
        "bin-dir": "bin/"
    }
}

@stof
Copy link
Member

stof commented Sep 12, 2014

I think your issue might be that behat/mink-goutte-driver supports both Goutte 1.x based on Guzzle 3 and Goutte 2.x based on Guzzle 4. Given that you don't specify the Goutte version, composer uses the latest version, and so will install Guzzle 4.
In guzzle 4, the name of options has changed, so configuring the certificate authority probably requires a different key

@KuenzelIT
Copy link

I had the same issue and stof's hint did lead me to the correct key, which is "verify" in Guzzle 5!

http://docs.guzzlephp.org/en/latest/clients.html#verify

@toin0u
Copy link

toin0u commented Feb 11, 2015

Have you solved this issue @j4m3s ?
@KuenzelIT is right. The correct behat.yml, in your case, looks like:

default:
    extensions:
        Behat\MinkExtension:
            sessions: 
                defaultHeadless: 
                    goutte:
                        guzzle_parameters:
                            verify: false

@j4m3s
Copy link
Author

j4m3s commented Feb 11, 2015

@toin0u I had to roll back to the version I was using before because of some other issues so didn't have to check it out any further (I'm still on the version using ssl.certificate_authority: false).

I'm sure you're right though - closing this ticket, sorry for leaving it hanging.

@j4m3s j4m3s closed this as completed Feb 11, 2015
@uptownhr
Copy link
Contributor

uptownhr commented Feb 5, 2016

Any update on this matter? I don't think should be closed as reverting back to a previous version is a fix. Here's my configs and error.

//error
cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) (GuzzleHttp\Exception\RequestException)
//composer.json
{
    "require": {
        "facebook/webdriver": "~1.1",
        "behat/mink": "^1.7",
        "behat/mink-goutte-driver": "^1.2"
    },
    "require-dev": {
        "behat/behat": "~3.0.4",
        "behat/mink-extension": "^2.1"
    },
    "scripts": {
    "behat": "behat"
    }
}
//behat.yml
default:
  extensions:
    Behat\MinkExtension:
      goutte:
        guzzle_parameters:
          verify: false
          ssl.certificate_authority: false
          curl.options:
            CURLOPT_SSL_VERIFYPEER: false
            CURLOPT_CERTINFO: false
            CURLOPT_TIMEOUT: 120

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

No branches or pull requests

5 participants