]> git.wh0rd.org - tt-rss.git/blobdiff - include/functions.php
curl: let's verify ssl peers
[tt-rss.git] / include / functions.php
index 6d183abaa9420ea03684bc2c553ad692c2f6cdbf..310081485ec2d097c8984c6987cecaf7f96e5481 100644 (file)
                        curl_setopt($ch, CURLOPT_MAXREDIRS, 20);
                        curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
                        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
-                       curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
                        curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
                        curl_setopt($ch, CURLOPT_USERAGENT, $useragent ? $useragent :
                                SELF_USER_AGENT);
                        }
 
                        if (!$post_query && $timestamp) {
-                               $context = stream_context_create(array(
-                                       'http' => array(
-                                               'method' => 'GET',
-                                               'header' => "If-Modified-Since: ".gmdate("D, d M Y H:i:s \\G\\M\\T\r\n", $timestamp)
-                                       )));
+                                $context = stream_context_create(array(
+                                         'http' => array(
+                                                       'method' => 'GET',
+                                                       'protocol_version'=> 1.1,
+                                                       'header' => "If-Modified-Since: ".gmdate("D, d M Y H:i:s \\G\\M\\T\r\n", $timestamp)
+                                         )));
                        } else {
-                               $context = NULL;
-                       }
+                                $context = stream_context_create(array(
+                                         'http' => array(
+                                                       'method' => 'GET',
+                                                       'protocol_version'=> 1.1
+                                         )));
+                       } 
 
                        $old_error = error_get_last();