From 696b812e41fea2e24d89f97078eeaafa6d256d75 Mon Sep 17 00:00:00 2001
From: Cerdic <cedric@yterium.com>
Date: Tue, 3 Jul 2018 16:29:42 +0000
Subject: [PATCH] Report de r24018 : Fix #4157 : les inconsistances de PHP nous
 avaient enduit en erreur. On croyait bien faire en explicitant tls:// comme
 protocole pour l'ouverture des sockets, grave erreur cela limitait a SSLv1.0.
 Il faut revenir a ssl:// pour avoir une negociation sans limite du protocole
 crypto et donv pouvoir acceder a TLSv1.1 ou TLSv1.2 pour les serveurs qui ne
 supportent que cela les autres etant non securises

---
 ecrire/inc/distant.php | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ecrire/inc/distant.php b/ecrire/inc/distant.php
index 3603556b77..c28aaf3681 100644
--- a/ecrire/inc/distant.php
+++ b/ecrire/inc/distant.php
@@ -1181,8 +1181,8 @@ function init_http($method, $url, $refuse_gz = false, $referer = '', $datas = ''
 		$scheme = 'http';
 		$noproxy = '';
 	} elseif ($t['scheme'] == 'https') {
-		$scheme = 'tls';
-		$noproxy = 'tls://';
+		$scheme = 'ssl';
+		$noproxy = 'ssl://';
 		if (!isset($t['port']) || !($port = $t['port'])) {
 			$t['port'] = 443;
 		}
@@ -1280,13 +1280,13 @@ function lance_requete(
 
 	$connect = '';
 	if ($http_proxy) {
-		if (defined('_PROXY_HTTPS_VIA_CONNECT') and $scheme == 'tls') {
+		if (defined('_PROXY_HTTPS_VIA_CONNECT') and in_array($scheme , array('tls','ssl'))) {
 			$path_host = (!$user ? '' : "$user@") . $host . (($port != 80) ? ":$port" : '');
 			$connect = 'CONNECT ' . $path_host . " $vers\r\n"
 				. "Host: $path_host\r\n"
 				. "Proxy-Connection: Keep-Alive\r\n";
 		} else {
-			$path = (($scheme == 'tls') ? 'https://' : "$scheme://")
+			$path = (in_array($scheme , array('tls','ssl')) ? 'https://' : "$scheme://")
 				. (!$user ? '' : "$user@")
 				. "$host" . (($port != 80) ? ":$port" : '') . $path;
 		}
-- 
GitLab