X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=src%2Fconfigtest.php;h=92a50484da709ce2acc3ac58c1aa8af9534e563a;hp=8356ebebe3da9bc0bbadec8bf6f5e669a768e8d2;hb=3ee5d63bdd6f215e9d4c8add39b88a10dab56972;hpb=95fde4c89e9b9c235cb3923cd1a286f94c93f449;ds=sidebyside
diff --git a/src/configtest.php b/src/configtest.php
index 8356ebeb..92a50484 100644
--- a/src/configtest.php
+++ b/src/configtest.php
@@ -632,7 +632,10 @@ if($useSendmail) {
echo $IND . "sendmail OK
\n";
} else {
- $stream = fsockopen( ($use_smtp_tls==1?'tls://':'').$smtpServerAddress, $smtpPort,
+ // NB: Using "ssl://" ensures the highest possible TLS version
+ // will be negotiated with the server (whereas "tls://" only
+ // uses TLS version 1.0)
+ $stream = fsockopen( ($use_smtp_tls==1?'ssl://':'').$smtpServerAddress, $smtpPort,
$errorNumber, $errorString);
if(!$stream) {
do_err("Error connecting to SMTP server \"$smtpServerAddress:$smtpPort\".".
@@ -736,7 +739,10 @@ if($useSendmail) {
echo "Checking IMAP service....
\n";
/** Can we open a connection? */
-$stream = fsockopen( ($use_imap_tls==1?'tls://':'').$imapServerAddress, $imapPort,
+// NB: Using "ssl://" ensures the highest possible TLS version
+// will be negotiated with the server (whereas "tls://" only
+// uses TLS version 1.0)
+$stream = fsockopen( ($use_imap_tls==1?'ssl://':'').$imapServerAddress, $imapPort,
$errorNumber, $errorString);
if(!$stream) {
do_err("Error connecting to IMAP server \"$imapServerAddress:$imapPort\".".