mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-10 08:53:27 -05:00
We "understand" localhost to be same as the local hostname as
returned by gethostname().
This commit is contained in:
parent
3bd8946ca0
commit
943800a534
1 changed files with 13 additions and 2 deletions
|
|
@ -766,10 +766,19 @@ ldap_pvt_tls_get_peer_hostname( void *s )
|
|||
}
|
||||
|
||||
int
|
||||
ldap_pvt_tls_check_hostname( void *s, char *name )
|
||||
ldap_pvt_tls_check_hostname( void *s, const char *name_in )
|
||||
{
|
||||
int i, ret = LDAP_LOCAL_ERROR;
|
||||
X509 *x;
|
||||
const char *name;
|
||||
|
||||
if( ldap_int_hostname &&
|
||||
( !name_in || !strcasecmp( name_in, "localhost" ) ) )
|
||||
{
|
||||
name = ldap_int_hostname;
|
||||
} else {
|
||||
name = name_in;
|
||||
}
|
||||
|
||||
x = SSL_get_peer_certificate((SSL *)s);
|
||||
if (!x)
|
||||
|
|
@ -1076,7 +1085,9 @@ ldap_int_tls_start ( LDAP *ld, LDAPConn *conn, LDAPURLDesc *srv )
|
|||
}
|
||||
|
||||
/* avoid NULL host */
|
||||
if( host == NULL ) host = "localhost";
|
||||
if( host == NULL ) {
|
||||
host = "localhost";
|
||||
}
|
||||
|
||||
(void) ldap_pvt_tls_init();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue