我正在嘗試將Behat帶到https受保護的項目,並且在啓動捲曲請求時水貂失敗。如何在Mink中配置捲曲參數?
Scenario: Loggin in # features/debt.feature:6
Given I am on "/" # FeatureContext::visit()
[curl] 51: SSL: certificate subject name 'ubuntu' does not match target host name 'wizard' [url] https://wizard/admin/dev.php/ [info] array (
'url' => 'https://wizard/admin/dev.php/',
'content_type' => NULL,
'http_code' => 0,
'header_size' => 0,
'request_size' => 0,
'filetime' => -1,
'ssl_verify_result' => 1,
'redirect_count' => 0,
'total_time' => 0.061943,
'namelookup_time' => 0.000234,
'connect_time' => 0.000344,
'pretransfer_time' => 0,
'size_upload' => 0,
'size_download' => 0,
'speed_download' => 0,
'speed_upload' => 0,
'download_content_length' => -1,
'upload_content_length' => -1,
'starttransfer_time' => 0,
'redirect_time' => 0,
'certinfo' =>
array (
),
) [debug] * About to connect() to wizard port 443 (#0)
* Trying 127.0.0.1... * connected
* Connected to wizard (127.0.0.1) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs
* SSL connection using DHE-RSA-AES256-SHA
* Server certificate:
* subject: CN=ubuntu
* start date: 2011-05-23 08:26:04 GMT
* expire date: 2021-05-20 08:26:04 GMT
* SSL: certificate subject name 'ubuntu' does not match target host name 'wizard'
* Closing connection #0
的問題可以通過設置這兩個參數捲曲來解決:
CURLOPT_SSL_VERIFYPEER = false
CURLOPT_CERTINFO = false
我知道,貂皮內部使用狂飲,從而啓動捲曲的請求。如何正確實例化curl選項的guzzle客戶端?
嗨,畢業你迴應。我在githug上看到過你的帖子,但是想知道是否可以使用behat.yml傳遞參數來進行goutte和guzzle?我們需要的不是'behat.mink.goutte.server_parameters'嗎? – Dziamid 2012-07-17 15:47:06
哦,我得到的GuzzleClient是沒有任何參數instanciated。 – Dziamid 2012-07-17 16:35:37
你究竟在哪裏調用setClient()? – Dziamid 2012-07-17 16:52:28