summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2014-11-29 14:44:25 +0100
committerBenny Baumann <BenBE@geshi.org>2014-11-29 14:44:25 +0100
commit34c3a6380c0e70b4648777b8b51e3a35117762df (patch)
treefab583fa763754c1046bd2ef46ad6a0039664241
parent203289a95a0f1b7db92729773babddf77b77495c (diff)
parent25936445de04c27c377f2de84f117100b43d533f (diff)
downloadcacert-devel-34c3a6380c0e70b4648777b8b51e3a35117762df.tar.gz
cacert-devel-34c3a6380c0e70b4648777b8b51e3a35117762df.tar.xz
cacert-devel-34c3a6380c0e70b4648777b8b51e3a35117762df.zip
Merge branch 'bug-1288' into testserver-stable
-rw-r--r--includes/general.php17
1 files changed, 13 insertions, 4 deletions
diff --git a/includes/general.php b/includes/general.php
index e131dbd..957156f 100644
--- a/includes/general.php
+++ b/includes/general.php
@@ -631,22 +631,31 @@
fputs($fp, "EHLO www.cacert.org\r\n");
do {
$line = fgets($fp, 4096);
- $has_starttls |= trim($line) == "220-STARTTLS";
+ $has_starttls |= trim($line) == "250-STARTTLS";
} while(substr($line, 0, 4) == "250-");
- if(substr($line, 0, 3) != "220") {
+ if(substr($line, 0, 3) != "250") {
fclose($fp);
continue;
}
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");
do {
$line = fgets($fp, 4096);
- $has_starttls |= trim($line) == "220-STARTTLS";
+ $has_starttls |= trim($line) == "250-STARTTLS";
} while(substr($line, 0, 4) == "250-");
- if(substr($line, 0, 3) != "220") {
+ if(substr($line, 0, 3) != "250") {
fclose($fp);
continue;
}