Browse Source

Bugfix: the curl option CURLOPT_SSL_VERIFYHOST is problematic

pull/3188/head
Michael 4 years ago
parent
commit
da8a48f89e
3 changed files with 11 additions and 4 deletions
  1. +3
    -1
      include/ParseUrl.php
  2. +6
    -2
      include/network.php
  3. +2
    -1
      include/poller.php

+ 3
- 1
include/ParseUrl.php View File

@ -146,7 +146,9 @@ class ParseUrl {
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, $a->get_useragent());
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (($check_cert) ? true : false));
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, (($check_cert) ? 2 : false));
if ($check_cert) {
@curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
}
$header = curl_exec($ch);
$curl_info = @curl_getinfo($ch);


+ 6
- 2
include/network.php View File

@ -118,7 +118,9 @@ function z_fetch_url($url,$binary = false, &$redirects = 0, $opts=array()) {
$check_cert = get_config('system','verifyssl');
@curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (($check_cert) ? true : false));
@curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, (($check_cert) ? 2 : false));
if ($check_cert) {
@curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
}
$prx = get_config('system','proxy');
if(strlen($prx)) {
@ -265,7 +267,9 @@ function post_url($url,$params, $headers = null, &$redirects = 0, $timeout = 0)
$check_cert = get_config('system','verifyssl');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (($check_cert) ? true : false));
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, (($check_cert) ? 2 : false));
if ($check_cert) {
@curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
}
$prx = get_config('system','proxy');
if(strlen($prx)) {
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);


+ 2
- 1
include/poller.php View File

@ -11,7 +11,6 @@ if (!file_exists("boot.php") AND (sizeof($_SERVER["argv"]) != 0)) {
}
use \Friendica\Core\Config;
use \Friendica\Core\PConfig;
require_once("boot.php");
@ -29,6 +28,8 @@ function poller_run($argv, $argc){
unset($db_host, $db_user, $db_pass, $db_data);
};
Config::load();
// Quit when in maintenance
if (Config::get('system', 'maintenance', true)) {
return;


Loading…
Cancel
Save