diff options
-rw-r--r-- | includes/general.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/includes/general.php b/includes/general.php index b3fd121..57268dc 100644 --- a/includes/general.php +++ b/includes/general.php @@ -587,6 +587,15 @@ } if($has_starttls) { + fputs($fp, "STARTTLS\r\n"); + do { + $line = fgets($fp, 4096); + } while(substr($line, 0, 4) == "220-"); + if(substr($line, 0, 3) != "220") { + fclose($fp); + continue; + } + stream_socket_enable_crypto($fp, true, STREAM_CRYPTO_METHOD_TLS_CLIENT); fputs($fp, "EHLO www.cacert.org\r\n"); |