1/ A vérifier si les modules mod_ldap et mod_authnz_ldap sont charg és dans
apache.
2/ Petite question : ton serveur Ldap accepte-t-il les connexions TLS ?
3/ A essayer :
D'après la doc d'Apache :
http://httpd.apache.org/docs/2.2/mod/mod_ldap.html#usingssltls
**********
The ability to create an SSL and TLS connections to an LDAP server is
defined by the directives LDAPTrustedGlobalCert<http://httpd.apache.org/d ocs/2.2/mod/mod_ldap.html#%20%20%20%20ldaptrustedglobalcert>,
LDAPTrustedClientCert<http://httpd.apache.org/docs/2.2/mod/mod_ldap.html# %20%20%20%20ldaptrustedclientcert>and
LDAPTrustedMode<http://httpd.apache.org/docs/2.2/mod/mod_ldap.html#%20%20 %20%20ldaptrustedmode>.
These directives specify the CA and optional client certificates to be us ed,
as well as the type of encryption to be used on the connection (none, SSL or
TLS/STARTTLS).
# Establish an SSL LDAP connection on port 636. Requires that
# mod_ldap and mod_authnz_ldap be loaded. Change the
# "yourdomain.example.com" to match your domain.
LDAPTrustedGlobalCert CA_DER /certs/certfile.der
<Location /ldap-status>
SetHandler ldap-status
Order deny,allow
Deny from all
Allow from yourdomain.example.com
AuthLDAPURL ldaps://127.0.0.1/dc=example,dc=com?uid?one
AuthzLDAPAuthoritative off
Require valid-user
</Location>
# Establish a TLS LDAP connection on port 389. Requires that
# mod_ldap and mod_authnz_ldap be loaded. Change the
# "yourdomain.example.com" to match your domain.
LDAPTrustedGlobalCert CA_DER /certs/certfile.der
<Location /ldap-status>
SetHandler ldap-status
Order deny,allow
Deny from all
Allow from yourdomain.example.com
AuthLDAPURL ldap://127.0.0.1/dc=example,dc=com?uid?one *TLS*
AuthzLDAPAuthoritative off
Require valid-user
</Location>
***********
Jean-Max Redonnet a écrit :
Bonjour,
Malgré tous mes efforts, multiples et répétés, je ne parviens
définitivement pas à configurer l'authentification LDAP en TLS sur mon
serveur Apache2.2.
Voilà ce que j'ai mis dans le /etc/apache2/ports.conf inclus dans
/etc/apache2/apache2.conf
LDAPTrustedGlobalCert CA_BASE64 /etc/ssl/cacert.pem
<VirtualHost 130.120.xxx.xxx:80>
LDAPTrustedClientCert CERT_BASE64 /etc/ssl/certs/xxx.ups-tlse.fr.crt
LDAPTrustedClientCert KEY_BASE64 /etc/ssl/private/xxx.ups-tlse.fr.key
LDAPTrustedMode TLS
<Location /ldap-status>
SetHandler ldap-status
order deny,allow
allow from xxx.ups-tlse.fr
allow from xxx.ups-tlse.fr
AuthType basic
AuthName "Auth LDAP"
AuthBasicProvider ldap
AuthLDAPURL ldap://
xxx.ups-tlse.fr/ou=Users,ou=People,dc=xxx,dc=ups-tlse,dc=fr?uid
AuthzLDAPAuthoritative off
require valid-user
</Location>
</VirtualHost>
OpenLDAP est installé et marche bien. Apache idem.
Mes certificats sont bons (je les utilise par ailleurs avec succès).
Je ne vois pas d'où peut venir le problème. Alors avant de swit cher vers le
module d'authentification via PAM (qui comble de l'ironie utilise LDAP av ec
bonheur), je m'en remet aux gens qui savent...
Dans la doc d'Apache, j'ai trouvé ça :
"The documentation for the SDK claims to support both SSL and STARTTLS,
however STARTTLS does not seem to work on all versions of the SDK. The
SSL/TLS mode can be set using the LDAPTrustedMode parameter. If an ldaps: //
URL is specified, SSL mode is forced. The OpenLDAP documentation notes th at
SSL (ldaps://) support has been deprecated to be replaced with TLS, altho ugh
the SSL functionality still works."
Alors, je me dis que je suis peut-être pas le seul à rencontrer des
problèmes...
Si vous avez des retours d'expérience ou des suggestions, je suis to ut ouï
Merci d'avance.
jMax
1/ A vérifier si les modules mod_ldap et mod_authnz_ldap sont charg és dans
apache.
2/ Petite question : ton serveur Ldap accepte-t-il les connexions TLS ?
3/ A essayer :
D'après la doc d'Apache :
http://httpd.apache.org/docs/2.2/mod/mod_ldap.html#usingssltls
**********
The ability to create an SSL and TLS connections to an LDAP server is
defined by the directives LDAPTrustedGlobalCert<http://httpd.apache.org/d ocs/2.2/mod/mod_ldap.html#%20%20%20%20ldaptrustedglobalcert>,
LDAPTrustedClientCert<http://httpd.apache.org/docs/2.2/mod/mod_ldap.html# %20%20%20%20ldaptrustedclientcert>and
LDAPTrustedMode<http://httpd.apache.org/docs/2.2/mod/mod_ldap.html#%20%20 %20%20ldaptrustedmode>.
These directives specify the CA and optional client certificates to be us ed,
as well as the type of encryption to be used on the connection (none, SSL or
TLS/STARTTLS).
# Establish an SSL LDAP connection on port 636. Requires that
# mod_ldap and mod_authnz_ldap be loaded. Change the
# "yourdomain.example.com" to match your domain.
LDAPTrustedGlobalCert CA_DER /certs/certfile.der
<Location /ldap-status>
SetHandler ldap-status
Order deny,allow
Deny from all
Allow from yourdomain.example.com
AuthLDAPURL ldaps://127.0.0.1/dc=example,dc=com?uid?one
AuthzLDAPAuthoritative off
Require valid-user
</Location>
# Establish a TLS LDAP connection on port 389. Requires that
# mod_ldap and mod_authnz_ldap be loaded. Change the
# "yourdomain.example.com" to match your domain.
LDAPTrustedGlobalCert CA_DER /certs/certfile.der
<Location /ldap-status>
SetHandler ldap-status
Order deny,allow
Deny from all
Allow from yourdomain.example.com
AuthLDAPURL ldap://127.0.0.1/dc=example,dc=com?uid?one *TLS*
AuthzLDAPAuthoritative off
Require valid-user
</Location>
***********
Jean-Max Redonnet a écrit :
Bonjour,
Malgré tous mes efforts, multiples et répétés, je ne parviens
définitivement pas à configurer l'authentification LDAP en TLS sur mon
serveur Apache2.2.
Voilà ce que j'ai mis dans le /etc/apache2/ports.conf inclus dans
/etc/apache2/apache2.conf
LDAPTrustedGlobalCert CA_BASE64 /etc/ssl/cacert.pem
<VirtualHost 130.120.xxx.xxx:80>
LDAPTrustedClientCert CERT_BASE64 /etc/ssl/certs/xxx.ups-tlse.fr.crt
LDAPTrustedClientCert KEY_BASE64 /etc/ssl/private/xxx.ups-tlse.fr.key
LDAPTrustedMode TLS
<Location /ldap-status>
SetHandler ldap-status
order deny,allow
allow from xxx.ups-tlse.fr
allow from xxx.ups-tlse.fr
AuthType basic
AuthName "Auth LDAP"
AuthBasicProvider ldap
AuthLDAPURL ldap://
xxx.ups-tlse.fr/ou=Users,ou=People,dc=xxx,dc=ups-tlse,dc=fr?uid
AuthzLDAPAuthoritative off
require valid-user
</Location>
</VirtualHost>
OpenLDAP est installé et marche bien. Apache idem.
Mes certificats sont bons (je les utilise par ailleurs avec succès).
Je ne vois pas d'où peut venir le problème. Alors avant de swit cher vers le
module d'authentification via PAM (qui comble de l'ironie utilise LDAP av ec
bonheur), je m'en remet aux gens qui savent...
Dans la doc d'Apache, j'ai trouvé ça :
"The documentation for the SDK claims to support both SSL and STARTTLS,
however STARTTLS does not seem to work on all versions of the SDK. The
SSL/TLS mode can be set using the LDAPTrustedMode parameter. If an ldaps: //
URL is specified, SSL mode is forced. The OpenLDAP documentation notes th at
SSL (ldaps://) support has been deprecated to be replaced with TLS, altho ugh
the SSL functionality still works."
Alors, je me dis que je suis peut-être pas le seul à rencontrer des
problèmes...
Si vous avez des retours d'expérience ou des suggestions, je suis to ut ouï
Merci d'avance.
jMax
1/ A vérifier si les modules mod_ldap et mod_authnz_ldap sont charg és dans
apache.
2/ Petite question : ton serveur Ldap accepte-t-il les connexions TLS ?
3/ A essayer :
D'après la doc d'Apache :
http://httpd.apache.org/docs/2.2/mod/mod_ldap.html#usingssltls
**********
The ability to create an SSL and TLS connections to an LDAP server is
defined by the directives LDAPTrustedGlobalCert<http://httpd.apache.org/d ocs/2.2/mod/mod_ldap.html#%20%20%20%20ldaptrustedglobalcert>,
LDAPTrustedClientCert<http://httpd.apache.org/docs/2.2/mod/mod_ldap.html# %20%20%20%20ldaptrustedclientcert>and
LDAPTrustedMode<http://httpd.apache.org/docs/2.2/mod/mod_ldap.html#%20%20 %20%20ldaptrustedmode>.
These directives specify the CA and optional client certificates to be us ed,
as well as the type of encryption to be used on the connection (none, SSL or
TLS/STARTTLS).
# Establish an SSL LDAP connection on port 636. Requires that
# mod_ldap and mod_authnz_ldap be loaded. Change the
# "yourdomain.example.com" to match your domain.
LDAPTrustedGlobalCert CA_DER /certs/certfile.der
<Location /ldap-status>
SetHandler ldap-status
Order deny,allow
Deny from all
Allow from yourdomain.example.com
AuthLDAPURL ldaps://127.0.0.1/dc=example,dc=com?uid?one
AuthzLDAPAuthoritative off
Require valid-user
</Location>
# Establish a TLS LDAP connection on port 389. Requires that
# mod_ldap and mod_authnz_ldap be loaded. Change the
# "yourdomain.example.com" to match your domain.
LDAPTrustedGlobalCert CA_DER /certs/certfile.der
<Location /ldap-status>
SetHandler ldap-status
Order deny,allow
Deny from all
Allow from yourdomain.example.com
AuthLDAPURL ldap://127.0.0.1/dc=example,dc=com?uid?one *TLS*
AuthzLDAPAuthoritative off
Require valid-user
</Location>
***********
Jean-Max Redonnet a écrit :
Bonjour,
Malgré tous mes efforts, multiples et répétés, je ne parviens
définitivement pas à configurer l'authentification LDAP en TLS sur mon
serveur Apache2.2.
Voilà ce que j'ai mis dans le /etc/apache2/ports.conf inclus dans
/etc/apache2/apache2.conf
LDAPTrustedGlobalCert CA_BASE64 /etc/ssl/cacert.pem
<VirtualHost 130.120.xxx.xxx:80>
LDAPTrustedClientCert CERT_BASE64 /etc/ssl/certs/xxx.ups-tlse.fr.crt
LDAPTrustedClientCert KEY_BASE64 /etc/ssl/private/xxx.ups-tlse.fr.key
LDAPTrustedMode TLS
<Location /ldap-status>
SetHandler ldap-status
order deny,allow
allow from xxx.ups-tlse.fr
allow from xxx.ups-tlse.fr
AuthType basic
AuthName "Auth LDAP"
AuthBasicProvider ldap
AuthLDAPURL ldap://
xxx.ups-tlse.fr/ou=Users,ou=People,dc=xxx,dc=ups-tlse,dc=fr?uid
AuthzLDAPAuthoritative off
require valid-user
</Location>
</VirtualHost>
OpenLDAP est installé et marche bien. Apache idem.
Mes certificats sont bons (je les utilise par ailleurs avec succès).
Je ne vois pas d'où peut venir le problème. Alors avant de swit cher vers le
module d'authentification via PAM (qui comble de l'ironie utilise LDAP av ec
bonheur), je m'en remet aux gens qui savent...
Dans la doc d'Apache, j'ai trouvé ça :
"The documentation for the SDK claims to support both SSL and STARTTLS,
however STARTTLS does not seem to work on all versions of the SDK. The
SSL/TLS mode can be set using the LDAPTrustedMode parameter. If an ldaps: //
URL is specified, SSL mode is forced. The OpenLDAP documentation notes th at
SSL (ldaps://) support has been deprecated to be replaced with TLS, altho ugh
the SSL functionality still works."
Alors, je me dis que je suis peut-être pas le seul à rencontrer des
problèmes...
Si vous avez des retours d'expérience ou des suggestions, je suis to ut ouï
Merci d'avance.
jMax
Bonjour,
1/ Un bon petit coup de "a2enmod nom-du-module" ne fait pas de mal pour l es
2 modules d'auth ldap
2/ OK pour le TLS si le ldapsearch répond comme il faut
3/ Juste avant de passer en TLS ou SSL, as tu essayé de faire un tes t sans
cryptage ?
Sinon que donne les log d'apache ?
TN
Jean-Max Redonnet a écrit :
Tout d'abord merci pour ta réponse.
1/ Je pense que les modules sont bien chargés ; en tout cas le
/etc/apache2/apache2.conf contient la directive
Include /etc/apache2/mods-enabled/*.load
qui inclut tous les fichiers .load de /etc/apache2/mods-enabled/ parmi
lesquels on trouve :
ldap.load qui contient LoadModule ldap_module
/usr/lib/apache2/modules/mod_ldap.so
et authnz_ldap.load qui contient LoadModule authnz_ldap_module
/usr/lib/apache2/modules/mod_authnz_ldap.so
Je pense que c'est suffisant pour pouvoir dire que les modules sont charg és
non ? Ou bien il y a un autre moyen de le vérifier (en interrogeant le
serveur en fonction par exemple ?)
2/ J'ai oublié de le préciser, mais oui, bien sûr, mon ser veur LDAP accepte
les connections TLS
Par exemple, quand je tape la commande :
ldapsearch -x *-ZZ* -H ldap://xxx.ups-tlse.fr -D
"cnmin,dc=xxx,dc=ups-tlse,dc=fr" -b
"ou=Users,ou=People,dc=xxx,dc=ups-tlse,dc=fr" -W
Aux niveaux des logs, j'obtiens :
slapd[18327]: conn=0 fd ACCEPT from IP0.120.xxx.xxx:41224 (I P0.120.xxx.xxx:389)
slapd[18327]: conn=0 op=0 EXT oid=1.3.6.1.4.1.1466.20037
slapd[18327]: conn=0 op=0 *STARTTLS*
slapd[18327]: conn=0 op=0 RESULT oid= err=0 text=
slapd[18327]: conn=0 fd *TLS established* tls_ssf8 ssf8
slapd[18327]: conn=0 op=1 BIND dn="cnmin,dc=xxx,dc=ups-tl se,dc=fr" method8
slapd[18327]: conn=0 op=1 BIND dn="cnmin,dc=xxx,dc=ups-tl se,dc=fr" mech=SIMPLE ssf=0
slapd[18327]: conn=0 op=1 RESULT tag— err=0 text=
slapd[18327]: conn=0 op=2 SRCH base="ou=Users,ou=People,dc=x xx,dc=ups-tlse,dc=fr" scope=2 deref=0 filter="(objectClass=*)"
slapd[18327]: conn=0 op=2 SEARCH RESULT tag1 err=0 nentries 1 text=
slapd[18327]: conn=0 op=3 UNBIND
slapd[18327]: conn=0 fd closed
Au niveau du point 3/ de ta réponse, je ne suis pas sûr d'avoi r compris la
chose à essayer ; mais en lisant l'exemple que tu retranscris et sur lequel
je me suis aussi appuyé pour établir ma config, je vois que tu mets en avant
l'ajout de l'option TLS Ã la fin de la ligne AuthLDAPURL. Si j'ai bi en lu la
doc, cette option ne sert qu'Ã surcharger la directive LDAPTrustedMo de que
j'ai bien mis à TLS. Ou alors, il y a quelque chose qui m'a éch appé :-(.
Quoi qu'il en soit, ça ne marche pas, que je mettes TLS dans l'un ou
l'autre, ni même aux deux endroits.
Ce qui m'inquiète le plus c'est qu'il m'affiche une internal server error
au lieu d'une authentification failed qui me paraîtraît de meil leur aloi.
En tout cas merci de te pencher sur mon problème. Je suis à l' écoute de
toutes les idées qui pourraient me sortir de cette impasse.
jMax
2009/4/23 Tan.N
1/ A vérifier si les modules mod_ldap et mod_authnz_ldap sont charg és
dans apache.
2/ Petite question : ton serveur Ldap accepte-t-il les connexions TLS ?
3/ A essayer :
D'après la doc d'Apache :
http://httpd.apache.org/docs/2.2/mod/mod_ldap.html#usingssltls
**********
The ability to create an SSL and TLS connections to an LDAP server is
defined by the directives LDAPTrustedGlobalCert<http://httpd.apache.org/ docs/2.2/mod/mod_ldap.html#%20%20%20%20ldaptrustedglobalcert>,
LDAPTrustedClientCert<http://httpd.apache.org/docs/2.2/mod/mod_ldap.html #%20%20%20%20ldaptrustedclientcert>and
LDAPTrustedMode<http://httpd.apache.org/docs/2.2/mod/mod_ldap.html#%20%2 0%20%20ldaptrustedmode>.
These directives specify the CA and optional client certificates to be u sed,
as well as the type of encryption to be used on the connection (none, SS L or
TLS/STARTTLS).
# Establish an SSL LDAP connection on port 636. Requires that
# mod_ldap and mod_authnz_ldap be loaded. Change the
# "yourdomain.example.com" to match your domain.
LDAPTrustedGlobalCert CA_DER /certs/certfile.der
<Location /ldap-status>
SetHandler ldap-status
Order deny,allow
Deny from all
Allow from yourdomain.example.com
AuthLDAPURL ldaps://127.0.0.1/dc=example,dc=com?uid?one
AuthzLDAPAuthoritative off
Require valid-user
</Location>
# Establish a TLS LDAP connection on port 389. Requires that
# mod_ldap and mod_authnz_ldap be loaded. Change the
# "yourdomain.example.com" to match your domain.
LDAPTrustedGlobalCert CA_DER /certs/certfile.der
<Location /ldap-status>
SetHandler ldap-status
Order deny,allow
Deny from all
Allow from yourdomain.example.com
AuthLDAPURL ldap://127.0.0.1/dc=example,dc=com?uid?one *TLS*
AuthzLDAPAuthoritative off
Require valid-user
</Location>
***********
Jean-Max Redonnet a écrit :
Bonjour,
Malgré tous mes efforts, multiples et répétés, je ne parviens
définitivement pas à configurer l'authentification LDAP en TLS sur mon
serveur Apache2.2.
Voilà ce que j'ai mis dans le /etc/apache2/ports.conf inclus dans
/etc/apache2/apache2.conf
LDAPTrustedGlobalCert CA_BASE64 /etc/ssl/cacert.pem
<VirtualHost 130.120.xxx.xxx:80>
LDAPTrustedClientCert CERT_BASE64 /etc/ssl/certs/xxx.ups-tlse.fr.crt
LDAPTrustedClientCert KEY_BASE64 /etc/ssl/private/xxx.ups-tlse.fr.ke y
LDAPTrustedMode TLS
<Location /ldap-status>
SetHandler ldap-status
order deny,allow
allow from xxx.ups-tlse.fr
allow from xxx.ups-tlse.fr
AuthType basic
AuthName "Auth LDAP"
AuthBasicProvider ldap
AuthLDAPURL ldap://
xxx.ups-tlse.fr/ou=Users,ou=People,dc=xxx,dc=ups-tlse,dc=fr?ui d
AuthzLDAPAuthoritative off
require valid-user
</Location>
</VirtualHost>
OpenLDAP est installé et marche bien. Apache idem.
Mes certificats sont bons (je les utilise par ailleurs avec succès) .
Je ne vois pas d'où peut venir le problème. Alors avant de swi tcher vers
le module d'authentification via PAM (qui comble de l'ironie utilise LDA P
avec bonheur), je m'en remet aux gens qui savent...
Dans la doc d'Apache, j'ai trouvé ça :
"The documentation for the SDK claims to support both SSL and STARTTLS,
however STARTTLS does not seem to work on all versions of the SDK. The
SSL/TLS mode can be set using the LDAPTrustedMode parameter. If an ldaps ://
URL is specified, SSL mode is forced. The OpenLDAP documentation notes t hat
SSL (ldaps://) support has been deprecated to be replaced with TLS, alth ough
the SSL functionality still works."
Alors, je me dis que je suis peut-être pas le seul à rencontre r des
problèmes...
Si vous avez des retours d'expérience ou des suggestions, je suis t out ouï
Merci d'avance.
jMax
Bonjour,
1/ Un bon petit coup de "a2enmod nom-du-module" ne fait pas de mal pour l es
2 modules d'auth ldap
2/ OK pour le TLS si le ldapsearch répond comme il faut
3/ Juste avant de passer en TLS ou SSL, as tu essayé de faire un tes t sans
cryptage ?
Sinon que donne les log d'apache ?
TN
Jean-Max Redonnet a écrit :
Tout d'abord merci pour ta réponse.
1/ Je pense que les modules sont bien chargés ; en tout cas le
/etc/apache2/apache2.conf contient la directive
Include /etc/apache2/mods-enabled/*.load
qui inclut tous les fichiers .load de /etc/apache2/mods-enabled/ parmi
lesquels on trouve :
ldap.load qui contient LoadModule ldap_module
/usr/lib/apache2/modules/mod_ldap.so
et authnz_ldap.load qui contient LoadModule authnz_ldap_module
/usr/lib/apache2/modules/mod_authnz_ldap.so
Je pense que c'est suffisant pour pouvoir dire que les modules sont charg és
non ? Ou bien il y a un autre moyen de le vérifier (en interrogeant le
serveur en fonction par exemple ?)
2/ J'ai oublié de le préciser, mais oui, bien sûr, mon ser veur LDAP accepte
les connections TLS
Par exemple, quand je tape la commande :
ldapsearch -x *-ZZ* -H ldap://xxx.ups-tlse.fr -D
"cn=admin,dc=xxx,dc=ups-tlse,dc=fr" -b
"ou=Users,ou=People,dc=xxx,dc=ups-tlse,dc=fr" -W
Aux niveaux des logs, j'obtiens :
slapd[18327]: conn=0 fd=13 ACCEPT from IP=130.120.xxx.xxx:41224 (I P=130.120.xxx.xxx:389)
slapd[18327]: conn=0 op=0 EXT oid=1.3.6.1.4.1.1466.20037
slapd[18327]: conn=0 op=0 *STARTTLS*
slapd[18327]: conn=0 op=0 RESULT oid= err=0 text=
slapd[18327]: conn=0 fd=13 *TLS established* tls_ssf=128 ssf=128
slapd[18327]: conn=0 op=1 BIND dn="cn=admin,dc=xxx,dc=ups-tl se,dc=fr" method=128
slapd[18327]: conn=0 op=1 BIND dn="cn=admin,dc=xxx,dc=ups-tl se,dc=fr" mech=SIMPLE ssf=0
slapd[18327]: conn=0 op=1 RESULT tag=97 err=0 text=
slapd[18327]: conn=0 op=2 SRCH base="ou=Users,ou=People,dc=x xx,dc=ups-tlse,dc=fr" scope=2 deref=0 filter="(objectClass=*)"
slapd[18327]: conn=0 op=2 SEARCH RESULT tag=101 err=0 nentries =31 text=
slapd[18327]: conn=0 op=3 UNBIND
slapd[18327]: conn=0 fd=13 closed
Au niveau du point 3/ de ta réponse, je ne suis pas sûr d'avoi r compris la
chose à essayer ; mais en lisant l'exemple que tu retranscris et sur lequel
je me suis aussi appuyé pour établir ma config, je vois que tu mets en avant
l'ajout de l'option TLS Ã la fin de la ligne AuthLDAPURL. Si j'ai bi en lu la
doc, cette option ne sert qu'Ã surcharger la directive LDAPTrustedMo de que
j'ai bien mis à TLS. Ou alors, il y a quelque chose qui m'a éch appé :-(.
Quoi qu'il en soit, ça ne marche pas, que je mettes TLS dans l'un ou
l'autre, ni même aux deux endroits.
Ce qui m'inquiète le plus c'est qu'il m'affiche une internal server error
au lieu d'une authentification failed qui me paraîtraît de meil leur aloi.
En tout cas merci de te pencher sur mon problème. Je suis à l' écoute de
toutes les idées qui pourraient me sortir de cette impasse.
jMax
2009/4/23 Tan.N <axaly@yahoo.fr>
1/ A vérifier si les modules mod_ldap et mod_authnz_ldap sont charg és
dans apache.
2/ Petite question : ton serveur Ldap accepte-t-il les connexions TLS ?
3/ A essayer :
D'après la doc d'Apache :
http://httpd.apache.org/docs/2.2/mod/mod_ldap.html#usingssltls
**********
The ability to create an SSL and TLS connections to an LDAP server is
defined by the directives LDAPTrustedGlobalCert<http://httpd.apache.org/ docs/2.2/mod/mod_ldap.html#%20%20%20%20ldaptrustedglobalcert>,
LDAPTrustedClientCert<http://httpd.apache.org/docs/2.2/mod/mod_ldap.html #%20%20%20%20ldaptrustedclientcert>and
LDAPTrustedMode<http://httpd.apache.org/docs/2.2/mod/mod_ldap.html#%20%2 0%20%20ldaptrustedmode>.
These directives specify the CA and optional client certificates to be u sed,
as well as the type of encryption to be used on the connection (none, SS L or
TLS/STARTTLS).
# Establish an SSL LDAP connection on port 636. Requires that
# mod_ldap and mod_authnz_ldap be loaded. Change the
# "yourdomain.example.com" to match your domain.
LDAPTrustedGlobalCert CA_DER /certs/certfile.der
<Location /ldap-status>
SetHandler ldap-status
Order deny,allow
Deny from all
Allow from yourdomain.example.com
AuthLDAPURL ldaps://127.0.0.1/dc=example,dc=com?uid?one
AuthzLDAPAuthoritative off
Require valid-user
</Location>
# Establish a TLS LDAP connection on port 389. Requires that
# mod_ldap and mod_authnz_ldap be loaded. Change the
# "yourdomain.example.com" to match your domain.
LDAPTrustedGlobalCert CA_DER /certs/certfile.der
<Location /ldap-status>
SetHandler ldap-status
Order deny,allow
Deny from all
Allow from yourdomain.example.com
AuthLDAPURL ldap://127.0.0.1/dc=example,dc=com?uid?one *TLS*
AuthzLDAPAuthoritative off
Require valid-user
</Location>
***********
Jean-Max Redonnet a écrit :
Bonjour,
Malgré tous mes efforts, multiples et répétés, je ne parviens
définitivement pas à configurer l'authentification LDAP en TLS sur mon
serveur Apache2.2.
Voilà ce que j'ai mis dans le /etc/apache2/ports.conf inclus dans
/etc/apache2/apache2.conf
LDAPTrustedGlobalCert CA_BASE64 /etc/ssl/cacert.pem
<VirtualHost 130.120.xxx.xxx:80>
LDAPTrustedClientCert CERT_BASE64 /etc/ssl/certs/xxx.ups-tlse.fr.crt
LDAPTrustedClientCert KEY_BASE64 /etc/ssl/private/xxx.ups-tlse.fr.ke y
LDAPTrustedMode TLS
<Location /ldap-status>
SetHandler ldap-status
order deny,allow
allow from xxx.ups-tlse.fr
allow from xxx.ups-tlse.fr
AuthType basic
AuthName "Auth LDAP"
AuthBasicProvider ldap
AuthLDAPURL ldap://
xxx.ups-tlse.fr/ou=Users,ou=People,dc=xxx,dc=ups-tlse,dc=fr?ui d
AuthzLDAPAuthoritative off
require valid-user
</Location>
</VirtualHost>
OpenLDAP est installé et marche bien. Apache idem.
Mes certificats sont bons (je les utilise par ailleurs avec succès) .
Je ne vois pas d'où peut venir le problème. Alors avant de swi tcher vers
le module d'authentification via PAM (qui comble de l'ironie utilise LDA P
avec bonheur), je m'en remet aux gens qui savent...
Dans la doc d'Apache, j'ai trouvé ça :
"The documentation for the SDK claims to support both SSL and STARTTLS,
however STARTTLS does not seem to work on all versions of the SDK. The
SSL/TLS mode can be set using the LDAPTrustedMode parameter. If an ldaps ://
URL is specified, SSL mode is forced. The OpenLDAP documentation notes t hat
SSL (ldaps://) support has been deprecated to be replaced with TLS, alth ough
the SSL functionality still works."
Alors, je me dis que je suis peut-être pas le seul à rencontre r des
problèmes...
Si vous avez des retours d'expérience ou des suggestions, je suis t out ouï
Merci d'avance.
jMax
Bonjour,
1/ Un bon petit coup de "a2enmod nom-du-module" ne fait pas de mal pour l es
2 modules d'auth ldap
2/ OK pour le TLS si le ldapsearch répond comme il faut
3/ Juste avant de passer en TLS ou SSL, as tu essayé de faire un tes t sans
cryptage ?
Sinon que donne les log d'apache ?
TN
Jean-Max Redonnet a écrit :
Tout d'abord merci pour ta réponse.
1/ Je pense que les modules sont bien chargés ; en tout cas le
/etc/apache2/apache2.conf contient la directive
Include /etc/apache2/mods-enabled/*.load
qui inclut tous les fichiers .load de /etc/apache2/mods-enabled/ parmi
lesquels on trouve :
ldap.load qui contient LoadModule ldap_module
/usr/lib/apache2/modules/mod_ldap.so
et authnz_ldap.load qui contient LoadModule authnz_ldap_module
/usr/lib/apache2/modules/mod_authnz_ldap.so
Je pense que c'est suffisant pour pouvoir dire que les modules sont charg és
non ? Ou bien il y a un autre moyen de le vérifier (en interrogeant le
serveur en fonction par exemple ?)
2/ J'ai oublié de le préciser, mais oui, bien sûr, mon ser veur LDAP accepte
les connections TLS
Par exemple, quand je tape la commande :
ldapsearch -x *-ZZ* -H ldap://xxx.ups-tlse.fr -D
"cnmin,dc=xxx,dc=ups-tlse,dc=fr" -b
"ou=Users,ou=People,dc=xxx,dc=ups-tlse,dc=fr" -W
Aux niveaux des logs, j'obtiens :
slapd[18327]: conn=0 fd ACCEPT from IP0.120.xxx.xxx:41224 (I P0.120.xxx.xxx:389)
slapd[18327]: conn=0 op=0 EXT oid=1.3.6.1.4.1.1466.20037
slapd[18327]: conn=0 op=0 *STARTTLS*
slapd[18327]: conn=0 op=0 RESULT oid= err=0 text=
slapd[18327]: conn=0 fd *TLS established* tls_ssf8 ssf8
slapd[18327]: conn=0 op=1 BIND dn="cnmin,dc=xxx,dc=ups-tl se,dc=fr" method8
slapd[18327]: conn=0 op=1 BIND dn="cnmin,dc=xxx,dc=ups-tl se,dc=fr" mech=SIMPLE ssf=0
slapd[18327]: conn=0 op=1 RESULT tag— err=0 text=
slapd[18327]: conn=0 op=2 SRCH base="ou=Users,ou=People,dc=x xx,dc=ups-tlse,dc=fr" scope=2 deref=0 filter="(objectClass=*)"
slapd[18327]: conn=0 op=2 SEARCH RESULT tag1 err=0 nentries 1 text=
slapd[18327]: conn=0 op=3 UNBIND
slapd[18327]: conn=0 fd closed
Au niveau du point 3/ de ta réponse, je ne suis pas sûr d'avoi r compris la
chose à essayer ; mais en lisant l'exemple que tu retranscris et sur lequel
je me suis aussi appuyé pour établir ma config, je vois que tu mets en avant
l'ajout de l'option TLS Ã la fin de la ligne AuthLDAPURL. Si j'ai bi en lu la
doc, cette option ne sert qu'Ã surcharger la directive LDAPTrustedMo de que
j'ai bien mis à TLS. Ou alors, il y a quelque chose qui m'a éch appé :-(.
Quoi qu'il en soit, ça ne marche pas, que je mettes TLS dans l'un ou
l'autre, ni même aux deux endroits.
Ce qui m'inquiète le plus c'est qu'il m'affiche une internal server error
au lieu d'une authentification failed qui me paraîtraît de meil leur aloi.
En tout cas merci de te pencher sur mon problème. Je suis à l' écoute de
toutes les idées qui pourraient me sortir de cette impasse.
jMax
2009/4/23 Tan.N
1/ A vérifier si les modules mod_ldap et mod_authnz_ldap sont charg és
dans apache.
2/ Petite question : ton serveur Ldap accepte-t-il les connexions TLS ?
3/ A essayer :
D'après la doc d'Apache :
http://httpd.apache.org/docs/2.2/mod/mod_ldap.html#usingssltls
**********
The ability to create an SSL and TLS connections to an LDAP server is
defined by the directives LDAPTrustedGlobalCert<http://httpd.apache.org/ docs/2.2/mod/mod_ldap.html#%20%20%20%20ldaptrustedglobalcert>,
LDAPTrustedClientCert<http://httpd.apache.org/docs/2.2/mod/mod_ldap.html #%20%20%20%20ldaptrustedclientcert>and
LDAPTrustedMode<http://httpd.apache.org/docs/2.2/mod/mod_ldap.html#%20%2 0%20%20ldaptrustedmode>.
These directives specify the CA and optional client certificates to be u sed,
as well as the type of encryption to be used on the connection (none, SS L or
TLS/STARTTLS).
# Establish an SSL LDAP connection on port 636. Requires that
# mod_ldap and mod_authnz_ldap be loaded. Change the
# "yourdomain.example.com" to match your domain.
LDAPTrustedGlobalCert CA_DER /certs/certfile.der
<Location /ldap-status>
SetHandler ldap-status
Order deny,allow
Deny from all
Allow from yourdomain.example.com
AuthLDAPURL ldaps://127.0.0.1/dc=example,dc=com?uid?one
AuthzLDAPAuthoritative off
Require valid-user
</Location>
# Establish a TLS LDAP connection on port 389. Requires that
# mod_ldap and mod_authnz_ldap be loaded. Change the
# "yourdomain.example.com" to match your domain.
LDAPTrustedGlobalCert CA_DER /certs/certfile.der
<Location /ldap-status>
SetHandler ldap-status
Order deny,allow
Deny from all
Allow from yourdomain.example.com
AuthLDAPURL ldap://127.0.0.1/dc=example,dc=com?uid?one *TLS*
AuthzLDAPAuthoritative off
Require valid-user
</Location>
***********
Jean-Max Redonnet a écrit :
Bonjour,
Malgré tous mes efforts, multiples et répétés, je ne parviens
définitivement pas à configurer l'authentification LDAP en TLS sur mon
serveur Apache2.2.
Voilà ce que j'ai mis dans le /etc/apache2/ports.conf inclus dans
/etc/apache2/apache2.conf
LDAPTrustedGlobalCert CA_BASE64 /etc/ssl/cacert.pem
<VirtualHost 130.120.xxx.xxx:80>
LDAPTrustedClientCert CERT_BASE64 /etc/ssl/certs/xxx.ups-tlse.fr.crt
LDAPTrustedClientCert KEY_BASE64 /etc/ssl/private/xxx.ups-tlse.fr.ke y
LDAPTrustedMode TLS
<Location /ldap-status>
SetHandler ldap-status
order deny,allow
allow from xxx.ups-tlse.fr
allow from xxx.ups-tlse.fr
AuthType basic
AuthName "Auth LDAP"
AuthBasicProvider ldap
AuthLDAPURL ldap://
xxx.ups-tlse.fr/ou=Users,ou=People,dc=xxx,dc=ups-tlse,dc=fr?ui d
AuthzLDAPAuthoritative off
require valid-user
</Location>
</VirtualHost>
OpenLDAP est installé et marche bien. Apache idem.
Mes certificats sont bons (je les utilise par ailleurs avec succès) .
Je ne vois pas d'où peut venir le problème. Alors avant de swi tcher vers
le module d'authentification via PAM (qui comble de l'ironie utilise LDA P
avec bonheur), je m'en remet aux gens qui savent...
Dans la doc d'Apache, j'ai trouvé ça :
"The documentation for the SDK claims to support both SSL and STARTTLS,
however STARTTLS does not seem to work on all versions of the SDK. The
SSL/TLS mode can be set using the LDAPTrustedMode parameter. If an ldaps ://
URL is specified, SSL mode is forced. The OpenLDAP documentation notes t hat
SSL (ldaps://) support has been deprecated to be replaced with TLS, alth ough
the SSL functionality still works."
Alors, je me dis que je suis peut-être pas le seul à rencontre r des
problèmes...
Si vous avez des retours d'expérience ou des suggestions, je suis t out ouï
Merci d'avance.
jMax