diff options
author | Nathan Gass | 2014-10-23 17:50:16 +0200 |
---|---|---|
committer | Nathan Gass | 2014-10-23 17:50:16 +0200 |
commit | bc0b7d5867aa6b8256bf28ec93b8b8b3777605a2 (patch) | |
tree | 43d96303b848442aa33e8b3af408f4f4ac199192 /it_url.class | |
parent | 84a957b5a4ee81673493eb5e6e2aaaa5752ee4aa (diff) | |
download | itools-bc0b7d5867aa6b8256bf28ec93b8b8b3777605a2.tar.gz itools-bc0b7d5867aa6b8256bf28ec93b8b8b3777605a2.tar.bz2 itools-bc0b7d5867aa6b8256bf28ec93b8b8b3777605a2.zip |
request_curl: verify ssl certificates, ensure ->headers is always set (compatibility to request method)
Diffstat (limited to 'it_url.class')
-rw-r--r-- | it_url.class | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/it_url.class b/it_url.class index 4d3c70b..5997141 100644 --- a/it_url.class +++ b/it_url.class @@ -414,8 +414,13 @@ static function curl_opts($p=array()) CURLOPT_LOW_SPEED_TIME => $p['timeout'], CURLOPT_FOLLOWLOCATION => false, CURLOPT_HTTPHEADER => $headers, - CURLOPT_SSL_VERIFYPEER => 0, - CURLOPT_SSL_VERIFYHOST => 0, + + CURLOPT_SSL_VERIFYPEER => true, + CURLOPT_SSL_VERIFYHOST => 2, + CURLOPT_CAPATH => '/etc/ssl/certs/', + CURLOPT_SSL_VERIFYPEER => 1, + CURLOPT_SSL_VERIFYHOST => 2, + CURLINFO_HEADER_OUT => 1, ]; } @@ -435,6 +440,7 @@ function request_curl($p=array()) if ($p['url']) $this->it_url($p['url']); + $url->headers = []; $p['headers'] = (array)$p['headers'] + array( 'Host' => $url->realhostname . $url->explicitport, |