} else if ( rc == 0 ) {
void *ssl;
- char *authid;
+ struct berval authid = { 0, NULL };
c->c_needs_tls_accept = 0;
c->c_ssf = c->c_tls_ssf;
}
- authid = (char *)ldap_pvt_tls_get_peer( ssl );
- slap_sasl_external( c, c->c_tls_ssf, authid );
+ rc = dnX509peerNormalize( ssl, &authid );
+ if ( rc != LDAP_SUCCESS ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "connection", LDAP_LEVEL_INFO,
+ "connection_read: conn %lu unable to get TLS client DN, error %d\n",
+ c->c_connid, rc));
+#else
+ Debug( LDAP_DEBUG_TRACE,
+ "connection_read(%d): unable to get TLS client DN "
+ "error=%d id=%lu\n",
+ s, rc, c->c_connid );
+#endif
+ }
+ slap_sasl_external( c, c->c_tls_ssf, authid.bv_val );
+ if ( authid.bv_val ) free( authid.bv_val );
}
connection_return( c );
ldap_pvt_thread_mutex_unlock( &connections_mutex );
op = slap_op_alloc( ber, msgid, tag, conn->c_n_ops_received++ );
+ op->vrFilter = NULL;
+
op->o_pagedresults_state = conn->c_pagedresults_state;
#ifdef LDAP_CONNECTIONLESS