Show
Ignore:
Timestamp:
12/02/04 23:01:58 (19 years ago)
Author:
jalet
Message:

TLS is now supported with the LDAP backend

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/config.py

    r1956 r1968  
    2222# 
    2323# $Log$ 
     24# Revision 1.58  2004/12/02 22:01:58  jalet 
     25# TLS is now supported with the LDAP backend 
     26# 
    2427# Revision 1.57  2004/11/22 21:53:38  jalet 
    2528# Added the reject_unknown directive to pykota.conf to reject user/group 
     
    337340            if ldapinfo[field].lower().startswith('attach(') : 
    338341                ldapinfo[field] = ldapinfo[field][7:-1] 
     342                 
     343        # should we use TLS, by default (if unset) value is NO         
     344        ldapinfo["ldaptls"] = self.isTrue(self.getGlobalOption("ldaptls", ignore=1)) 
     345        ldapinfo["cacert"] = self.getGlobalOption("cacert", ignore=1) 
     346        if ldapinfo["cacert"] : 
     347            ldapinfo["cacert"] = ldapinfo["cacert"].strip() 
     348        if ldapinfo["ldaptls"] :     
     349            if not os.access(ldapinfo["cacert"] or "", os.R_OK) : 
     350                raise PyKotaConfigError, _("Option ldaptls is set, but certificate %s is not readable.") % str(ldapinfo["cacert"]) 
    339351        return ldapinfo 
    340352