From: Julio Sánchez Fernández Date: Tue, 13 Jul 1999 19:32:51 +0000 (+0000) Subject: First version with TLS. Untested. X-Git-Tag: OPENLDAP_REL_ENG_2_BP~147 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=70fe83b1d25fa0aa3140b443fcbf2e6e13cfd72f;p=openldap First version with TLS. Untested. --- diff --git a/libraries/libldap/open.c b/libraries/libldap/open.c index e9a7353ab6..419b4277e0 100644 --- a/libraries/libldap/open.c +++ b/libraries/libldap/open.c @@ -252,6 +252,20 @@ open_ldap_connection( LDAP *ld, Sockbuf *sb, const char *host, int defport, ber_pvt_sb_set_io( sb, &ber_pvt_sb_io_tcp, NULL ); +#ifdef HAVE_TLS + if ( ld->ld_options.ldo_tls_mode == LDAP_OPT_X_TLS_HARD ) { + /* + * Fortunately, the lib uses blocking io... + */ + if ( ldap_pvt_tls_connect( sb, ld->ld_options.ldo_tls_ctx ) < + 0 ) { + return -1; + } + /* FIXME: hostname of server must be compared with name in + * certificate.... + */ + } +#endif if ( krbinstancep != NULL ) { #ifdef HAVE_KERBEROS char *c;