add verifypeer & verifyhost config options

This commit is contained in:
a-sansara 2017-03-15 10:28:52 +01:00
parent ee33f03abf
commit 7f6fdfaf36
2 changed files with 5 additions and 4 deletions

View File

@ -4,6 +4,8 @@
debug : 1 debug : 1
protocol : https:// protocol : https://
hostname : pwsserver.docker hostname : pwsserver.docker
verifypeer : 0
verifyhost : 0
# file storing the server 's session id - must be out of DocumentRoot and read/writable by server # file storing the server 's session id - must be out of DocumentRoot and read/writable by server
store : wsess store : wsess
login : test login : test

View File

@ -226,10 +226,9 @@ class Client
curl_setopt($curl, CURLOPT_HEADER , true); curl_setopt($curl, CURLOPT_HEADER , true);
curl_setopt($curl, CURLOPT_COOKIESESSION , false); curl_setopt($curl, CURLOPT_COOKIESESSION , false);
curl_setopt($curl, CURLOPT_USERAGENT , $this->config['key']); curl_setopt($curl, CURLOPT_USERAGENT , $this->config['key']);
if (preg_match('/^https:/i', $this->config['protocol'])) { curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, $this->config['verifypeer']);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, $this->config['verifyhost']);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
}
if (isset($this->config['http']) && isset($this->config['http']['user']) && isset($this->config['http']['password'])) { 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_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($curl, CURLOPT_USERPWD , $this->config['http']['user'] . ':'. $this->config['http']['password']); curl_setopt($curl, CURLOPT_USERPWD , $this->config['http']['user'] . ':'. $this->config['http']['password']);