]> git.sur5r.net Git - openldap/commitdiff
Minor cleanup
authorKurt Zeilenga <kurt@openldap.org>
Tue, 18 Sep 2001 17:35:47 +0000 (17:35 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 18 Sep 2001 17:35:47 +0000 (17:35 +0000)
libraries/libldap/tls.c

index ac7fc6a987b0722570668e98caf135ba14f2a2e9..6c917d3009327667976e88e57c872f5dbeff5556 100644 (file)
@@ -1055,6 +1055,9 @@ ldap_int_tls_start ( LDAP *ld, LDAPConn *conn, LDAPURLDesc *srv )
                host = conn->lconn_server->lud_host;
        }
 
+       /* avoid NULL host */
+       if( host == NULL ) host = "localhost";
+
        (void) ldap_pvt_tls_init();
 
        /*
@@ -1069,11 +1072,8 @@ ldap_int_tls_start ( LDAP *ld, LDAPConn *conn, LDAPURLDesc *srv )
        assert( ssl != NULL );
 
        /* 
-        * compare host with name(s) in certificate. avoid NULL host
+        * compare host with name(s) in certificate
         */
-
-       if( host == NULL )
-               host = "localhost";
        ld->ld_errno = ldap_pvt_tls_check_hostname( ssl, host );
        if (ld->ld_errno != LDAP_SUCCESS) {
                return ld->ld_errno;