Allow SSL socket context to be specified as well
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 21 Jan 2014 03:47:03 +0000 (03:47 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 21 Jan 2014 03:47:03 +0000 (03:47 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@14433 7612ce4b-ef26-0410-bec9-ea0150e637f0

class/deliver/Deliver_SMTP.class.php
config/config_local.example.php
functions/imap_general.php

index 641fbe79b3ac11e294497e48d355579462190b44..fc61d35263b0b4b99cc75a417229672cdb7dfcc0 100644 (file)
@@ -98,8 +98,6 @@ class Deliver_SMTP extends Deliver {
             if ((check_php_version(4,3)) && (extension_loaded('openssl'))) {
                 if (function_exists('stream_socket_client')) {
                     $server_address = 'ssl://' . $host . ':' . $port;
-                    if (!empty($ssl_options))
-                        $ssl_options = array('ssl' => $ssl_options);
                     $ssl_context = @stream_context_create($ssl_options);
                     $connect_timeout = ini_get('default_socket_timeout');
                     // null timeout is broken
index bcb482c672a5eac89a27b461d7ea83f8b309b50c..eb425007f8878555ef1772fd0d7599f56ade00ca 100644 (file)
  *
  * $smtpSslOptions allows more control over the SSL context used
  * when connecting to the SMTP server over SSL/TLS.  See:
+ * http://www.php.net/manual/context.php and in particular
  * http://php.net/manual/context.ssl.php
  * For example, you can specify a CA file that corresponds
  * to your server's certificate and make sure that the
  * server's certificate is validated when connecting:
  * $smtpSslOptions = array(
- *     'cafile' => '/etc/pki/tls/certs/ca-bundle.crt',
- *     'verify_peer' => true,
- *     'verify_depth' => 3,
+ *     'ssl' => array(
+ *         'cafile' => '/etc/pki/tls/certs/ca-bundle.crt',
+ *         'verify_peer' => true,
+ *         'verify_depth' => 3,
+ *     ),
  * );
  *
  * $imapSslOptions allows more control over the SSL context used
  * when connecting to the IMAP server over SSL/TLS.  See:
+ * http://www.php.net/manual/context.php and in particular
  * http://php.net/manual/context.ssl.php
  * For example, you can specify a CA file that corresponds
  * to your server's certificate and make sure that the
  * server's certificate is validated when connecting:
  * $imapSslOptions = array(
- *     'cafile' => '/etc/pki/tls/certs/ca-bundle.crt',
- *     'verify_peer' => true,
- *     'verify_depth' => 3,
+ *     'ssl' => array(
+ *         'cafile' => '/etc/pki/tls/certs/ca-bundle.crt',
+ *         'verify_peer' => true,
+ *         'verify_depth' => 3,
+ *     ),
  * );
  */
 
index cb6dfe78d8f6574a2e67b1c7e771d6489949f56f..56cc9bae445d0cf2cd394b35be64b5e43ffd8f91 100755 (executable)
@@ -691,8 +691,6 @@ function sqimap_create_stream($server,$port,$tls=0,$ssl_options=array()) {
         if ((check_php_version(4,3)) and (extension_loaded('openssl'))) {
             if (function_exists('stream_socket_client')) {
                 $server_address = 'ssl://' . $server . ':' . $port;
-                if (!empty($ssl_options))
-                    $ssl_options = array('ssl' => $ssl_options);
                 $ssl_context = @stream_context_create($ssl_options);
                 $connect_timeout = ini_get('default_socket_timeout');
                 // null timeout is broken