MDL-33925: auth_imap: add self-signed cert support
authorTim Lock <tim.lock@netspot.com.au>
Wed, 4 Dec 2013 04:12:49 +0000 (14:42 +1030)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Thu, 12 Dec 2013 11:52:51 +0000 (12:52 +0100)
auth/imap/auth.php
auth/imap/config.html

index ede7600..b0d7f9f 100644 (file)
@@ -73,6 +73,10 @@ class auth_plugin_imap extends auth_plugin_base {
                     $host = '{'.$host.":{$this->config->port}/imap/tls}";
                 break;
 
+                case 'imapnosslcert':
+                    $host = '{'.$host.":{$this->config->port}/imap/novalidate-cert}";
+                break;
+
                 default:
                     $host = '{'.$host.":{$this->config->port}/imap}";
             }
index e36fdd0..914d14f 100644 (file)
@@ -44,7 +44,7 @@ if (!isset($config->changepasswordurl)) {
     <td>
         <?php
 
-        $imaptypes = array('imap', 'imapssl', 'imapcert', 'imaptls');
+        $imaptypes = array('imap', 'imapssl', 'imapcert', 'imapnosslcert', 'imaptls');
         foreach ($imaptypes as $imaptype) {
             $imapoptions[$imaptype] = $imaptype;
         }