diff --git a/config/pwsclient.yml.dist b/config/pwsclient.yml.dist index 8a44b22..2ab45b3 100644 --- a/config/pwsclient.yml.dist +++ b/config/pwsclient.yml.dist @@ -4,6 +4,8 @@ debug : 1 protocol : https:// hostname : pwsserver.docker +verifypeer : 0 +verifyhost : 0 # file storing the server 's session id - must be out of DocumentRoot and read/writable by server store : wsess login : test diff --git a/src/MetaTech/Ws/Client.php b/src/MetaTech/Ws/Client.php index 6e2087b..9048297 100644 --- a/src/MetaTech/Ws/Client.php +++ b/src/MetaTech/Ws/Client.php @@ -226,10 +226,9 @@ class Client curl_setopt($curl, CURLOPT_HEADER , true); curl_setopt($curl, CURLOPT_COOKIESESSION , false); curl_setopt($curl, CURLOPT_USERAGENT , $this->config['key']); - if (preg_match('/^https:/i', $this->config['protocol'])) { - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); - } + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, $this->config['verifypeer']); + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, $this->config['verifyhost']); + if (isset($this->config['http']) && isset($this->config['http']['user']) && isset($this->config['http']['password'])) { curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY); curl_setopt($curl, CURLOPT_USERPWD , $this->config['http']['user'] . ':'. $this->config['http']['password']);