diff --git a/ecrire/inc/distant.php b/ecrire/inc/distant.php
index 62f2dbcd53cd47029343bfe37865566e7aa3cd43..adf4cc08a86e0800009d403e1649c91ee120bdd2 100644
--- a/ecrire/inc/distant.php
+++ b/ecrire/inc/distant.php
@@ -471,7 +471,11 @@ function init_http($get, $url, $refuse_gz=false, $uri_referer = '') {
 	$host = $t['host'];
 	if ($t['scheme'] == 'http') {
 		$scheme = 'http'; $scheme_fsock='';
-	} else {
+	} elseif ($t['scheme'] == 'https') {
+		$scheme = 'ssl'; $scheme_fsock='ssl://';
+		if (!isset($t['port']) || !($port = $t['port'])) $t['port'] = 443;
+	} 
+	else {
 		$scheme = $t['scheme']; $scheme_fsock=$scheme.'://';
 	}
 	if (!isset($t['port']) || !($port = $t['port'])) $port = 80;