Index: defparams.pl
===================================================================
RCS file: /var/lib/cvs/youri/bugzilla/defparams.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -a -u -r1.1 -r1.2
--- defparams.pl	17 Feb 2005 22:17:39 -0000	1.1
+++ defparams.pl	17 Feb 2005 23:58:27 -0000	1.2
@@ -392,6 +392,13 @@
   },
 
   {
+   name => 'LDAPcafile',
+   desc => 'The certification authority certificate needed for LDAPS connection',
+   type => 't',
+   default => ''
+  },
+
+  {
    name => 'LDAPbinddn',
    desc => 'If your LDAP server requires that you use a binddn and password ' .
            'instead of binding anonymously, enter it here ' .
Index: LDAP.pm
===================================================================
RCS file: /var/lib/cvs/youri/bugzilla/Bugzilla/Auth/LDAP.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -a -u -r1.1 -r1.2
--- LDAP.pm	17 Feb 2005 22:17:50 -0000	1.1
+++ LDAP.pm	17 Feb 2005 23:58:27 -0000	1.2
@@ -57,12 +57,22 @@
     if ($LDAPserver eq "") {
         return (AUTH_ERROR, undef, "server_not_defined");
     }
+    my $LDAPcafile = Param("LDAPcafile");
 
-    my $LDAPport = "389";  # default LDAP port
-    if($LDAPserver =~ /:/) {
-        ($LDAPserver, $LDAPport) = split(":",$LDAPserver);
+    my $LDAPconn;
+    if ($LDAPcafile) {
+	$LDAPconn = Net::LDAP->new(
+	    $LDAPserver,
+	    cafile => $LDAPcafile,
+	    verify => "require",
+	    version => 3
+	);
+    } else {
+	$LDAPconn = Net::LDAP->new(
+	    $LDAPserver,
+	    version => 3
+	);
     }
-    my $LDAPconn = Net::LDAP->new($LDAPserver, port => $LDAPport, version => 3);
     if(!$LDAPconn) {
         return (AUTH_ERROR, undef, "connect_failed");
     }
