1
Do not check server hostname when TLS_REQCERT is 'allow'.
3
If server certificate hostname does not match the server hostname,
4
connection is closed even if client has set TLS_REQCERT to 'allow'. This
5
is wrong - the documentation says, that bad certificates are being
6
ignored when TLS_REQCERT is set to 'allow'.
8
Author: Jan Vcelak <jvcelak@redhat.com>
12
diff --git a/libraries/libldap/tls2.c b/libraries/libldap/tls2.c
13
index f38db27..3f05c1e 100644
14
--- a/libraries/libldap/tls2.c
15
+++ b/libraries/libldap/tls2.c
16
@@ -838,7 +838,8 @@ ldap_int_tls_start ( LDAP *ld, LDAPConn *conn, LDAPURLDesc *srv )
18
* compare host with name(s) in certificate
20
- if (ld->ld_options.ldo_tls_require_cert != LDAP_OPT_X_TLS_NEVER) {
21
+ if (ld->ld_options.ldo_tls_require_cert != LDAP_OPT_X_TLS_NEVER &&
22
+ ld->ld_options.ldo_tls_require_cert != LDAP_OPT_X_TLS_ALLOW) {
23
ld->ld_errno = ldap_pvt_tls_check_hostname( ld, ssl, host );
24
if (ld->ld_errno != LDAP_SUCCESS) {