Using:

   - Flask
   - Windows
   - Ldap3
   - Connect using TLS
   - Attaching Apache mod conf file

Using Flask development server ldap user \ password authenticated fine.
When calling in Apache mod_wsgi received  "unknown encoding: cp0" error on 
bind()

Appreciate any ideas.

Below is the ldap code snippet:

def auth(serverName, domain, username, password):
    ldap_server = 'ldaps://%s:636' % (serverName)                         
    server = Server(ldap_server, get_info=ALL, mode=IP_V4_ONLY, 
connect_timeout=5)
    if (not server.check_availability()):
        raise ValueError('Unable to connect to server %s' % server)


    conDict = {'domain': domain, 'username': username} 
    user_dn = "%(domain)s\\%(username)s" % conDict
    connection = Connection(server, user_dn, password=password, read_only=
True, receive_timeout=5)
    authenticated = connection.bind()


    return authenticated 

        

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.
#<VirtualHost *:80>
#   WSGIDaemonProcess OurApp user=user group=us threads=5
#   WSGIScriptAlias / /home/user/OurApp/ourapp.wsgi
#   <Directory /home/user/OurApp>
#      WSGIProcessGroup OurApp
#      WSGIApplicationGroup %{GLOBAL}
#      Order deny,allow
#      Allow from all
#   </Directory>
#  <Files ourapp.wsgi>
#    Require all granted
#  </Files>
#  ErrorLog ${APACHE_LOG_DIR}/error.log
#  LogLevel warn
#  CustomLog ${APACHE_LOG_DIR}/access.log combined
#</VirtualHost>


<VirtualHost mewl7167:5001>
#<VirtualHost 172.16.6.5:5001>
        ServerName mewl7167
#       ServerAlias KMS_API.com
        WSGIScriptReloading On
        WSGIScriptAlias / C:\workspace\test\WSGI\test_wsgi.py
        <Directory C:\workspace\test\WSGI>
                Require all granted
        </Directory>
        LogLevel debug
        SSLEngine on    
        SSLProtocol -all +TLSv1.2 +TLSv1.1
    SSLCertificateFile C:\workspace\test\WSGI\certificates\KMS_srv.crt
    SSLCertificateKeyFile C:\workspace\test\WSGI\certificates\KMS_srv_pKey.pem
        
        #client CA
        SSLVerifyClient require
        SSLVerifyDepth 2
        SSLCACertificateFile 
"C:\workspace\test\WSGI\certificates\KMS_User_Inter01_caChain.crt"
</VirtualHost>


Reply via email to