summaryrefslogtreecommitdiff
path: root/it_url.class
diff options
context:
space:
mode:
authorNathan Gass2014-10-23 17:50:16 +0200
committerNathan Gass2014-10-23 17:50:16 +0200
commitbc0b7d5867aa6b8256bf28ec93b8b8b3777605a2 (patch)
tree43d96303b848442aa33e8b3af408f4f4ac199192 /it_url.class
parent84a957b5a4ee81673493eb5e6e2aaaa5752ee4aa (diff)
downloaditools-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.class10
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,