我正在使用Mink 1.4,使用Goutte驅動程序。貂 - Goutte驅動器cURL SSL錯誤
我試圖在頁面中設置一些表單域值,然後單擊提交該表單的按鈕。
但後來我得到這個錯誤
Fatal error: Uncaught exception 'Guzzle\Http\Exception\CurlException' with message ' in phar://C:/Documents and Settings/User/My Documents/Dropbox/kar_rental/inc/mink.phar/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php on line 579
Guzzle\Http\Exception\CurlException: [curl] 60: SSL certificate problem, verify that the CA cert is OK...
我認爲因爲我設置CURLOPT_SSL_VERIFYPEER
爲false,它不應該檢查SSL。
這裏是我的代碼:
foreach ($this->_sites_data as $site_name => $site_data)
{
// Instantiate Mink's Goutte Driver
$clientOptions = array(
'curl.options' => array(
'CURLOPT_SSL_VERIFYPEER' => false,
'CURLOPT_CERTINFO' => false,
'CURLOPT_TIMEOUT' => 120
),
'ssl.certificate_authority' => 'system'
);
$client = new \Behat\Mink\Driver\Goutte\Client();
$client->setClient(new \Guzzle\Http\Client($site_data['form_data']['form_url'], $clientOptions));
$driver = new \Behat\Mink\Driver\GoutteDriver($client);
// Initialize Mink
$session = new \Behat\Mink\Session($driver);
// Start session
$session->start();
foreach ($site_data['form_data']['post_fields'] as $days => $post_fields)
{
// Open form page
$session->visit($site_data['form_data']['form_url']);
$page = $session->getPage();
foreach ($post_fields as $post_field_name => $post_field_value)
{
$el = $page->find('css', '#' . $post_field_name);
$el->setValue($post_field_value);
}
$el = $page->find('css', $site_data['form_data']['submit_element_css']);
$el->click();
}
$session->reset();
}在GOUTTE