1 /* tls_g.c - Handle tls/ssl using GNUTLS. */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 2008-2017 The OpenLDAP Foundation.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted only as authorized by the OpenLDAP
12 * A copy of this license is available in the file LICENSE in the
13 * top-level directory of the distribution or, alternatively, at
14 * <http://www.OpenLDAP.org/license.html>.
16 /* ACKNOWLEDGEMENTS: GNUTLS support written by Howard Chu and
17 * Emily Backes; sponsored by The Written Word (thewrittenword.com)
18 * and Stanford University (stanford.edu).
25 #include "ldap_config.h"
29 #include <ac/stdlib.h>
31 #include <ac/socket.h>
32 #include <ac/string.h>
35 #include <ac/unistd.h>
37 #include <ac/dirent.h>
44 #include <gnutls/gnutls.h>
45 #include <gnutls/x509.h>
47 typedef struct tlsg_ctx {
48 gnutls_certificate_credentials_t cred;
49 gnutls_dh_params_t dh_params;
50 unsigned long verify_depth;
53 gnutls_priority_t prios;
55 ldap_pvt_thread_mutex_t ref_mutex;
59 typedef struct tlsg_session {
60 gnutls_session_t session;
62 struct berval peer_der_dn;
65 static int tlsg_parse_ciphers( tlsg_ctx *ctx, char *suites );
66 static int tlsg_cert_verify( tlsg_session *s );
71 tlsg_mutex_init( void **priv )
74 ldap_pvt_thread_mutex_t *lock = LDAP_MALLOC( sizeof( ldap_pvt_thread_mutex_t ));
79 err = ldap_pvt_thread_mutex_init( lock );
89 tlsg_mutex_destroy( void **lock )
91 int err = ldap_pvt_thread_mutex_destroy( *lock );
97 tlsg_mutex_lock( void **lock )
99 return ldap_pvt_thread_mutex_lock( *lock );
103 tlsg_mutex_unlock( void **lock )
105 return ldap_pvt_thread_mutex_unlock( *lock );
109 tlsg_thr_init( void )
111 gnutls_global_set_mutex (tlsg_mutex_init,
116 #endif /* LDAP_R_COMPILE */
119 * Initialize TLS subsystem. Should be called only once.
124 gnutls_global_init();
129 * Tear down the TLS subsystem. Should only be called once.
134 gnutls_global_deinit();
138 tlsg_ctx_new ( struct ldapoptions *lo )
142 ctx = ber_memcalloc ( 1, sizeof (*ctx) );
144 if ( gnutls_certificate_allocate_credentials( &ctx->cred )) {
149 gnutls_priority_init( &ctx->prios, "NORMAL", NULL );
150 #ifdef LDAP_R_COMPILE
151 ldap_pvt_thread_mutex_init( &ctx->ref_mutex );
154 return (tls_ctx *)ctx;
158 tlsg_ctx_ref( tls_ctx *ctx )
160 tlsg_ctx *c = (tlsg_ctx *)ctx;
161 LDAP_MUTEX_LOCK( &c->ref_mutex );
163 LDAP_MUTEX_UNLOCK( &c->ref_mutex );
167 tlsg_ctx_free ( tls_ctx *ctx )
169 tlsg_ctx *c = (tlsg_ctx *)ctx;
174 LDAP_MUTEX_LOCK( &c->ref_mutex );
175 refcount = --c->refcount;
176 LDAP_MUTEX_UNLOCK( &c->ref_mutex );
179 gnutls_priority_deinit( c->prios );
180 gnutls_certificate_free_credentials( c->cred );
182 gnutls_dh_params_deinit( c->dh_params );
187 tlsg_getfile( const char *path, gnutls_datum_t *buf )
192 fd = open( path, O_RDONLY );
193 if ( fd >= 0 && fstat( fd, &st ) == 0 ) {
194 buf->size = st.st_size;
195 buf->data = LDAP_MALLOC( st.st_size + 1 );
197 rc = read( fd, buf->data, st.st_size );
199 if ( rc < st.st_size )
208 /* This is the GnuTLS default */
209 #define VERIFY_DEPTH 6
212 * initialize a new TLS context
215 tlsg_ctx_init( struct ldapoptions *lo, struct ldaptls *lt, int is_server )
217 tlsg_ctx *ctx = lo->ldo_tls_ctx;
220 if ( lo->ldo_tls_ciphersuite &&
221 tlsg_parse_ciphers( ctx, lt->lt_ciphersuite )) {
222 Debug( LDAP_DEBUG_ANY,
223 "TLS: could not set cipher list %s.\n",
224 lo->ldo_tls_ciphersuite, 0, 0 );
228 if (lo->ldo_tls_cacertdir != NULL) {
229 Debug( LDAP_DEBUG_ANY,
230 "TLS: warning: cacertdir not implemented for gnutls\n",
234 if (lo->ldo_tls_cacertfile != NULL) {
235 rc = gnutls_certificate_set_x509_trust_file(
238 GNUTLS_X509_FMT_PEM );
239 if ( rc < 0 ) return -1;
242 if ( lo->ldo_tls_certfile && lo->ldo_tls_keyfile ) {
243 gnutls_x509_privkey_t key;
245 gnutls_x509_crt_t certs[VERIFY_DEPTH];
246 unsigned int max = VERIFY_DEPTH;
248 rc = gnutls_x509_privkey_init( &key );
251 /* OpenSSL builds the cert chain for us, but GnuTLS
252 * expects it to be present in the certfile. If it's
253 * not, we have to build it ourselves. So we have to
254 * do some special checks here...
256 rc = tlsg_getfile( lt->lt_keyfile, &buf );
258 rc = gnutls_x509_privkey_import( key, &buf,
259 GNUTLS_X509_FMT_PEM );
260 LDAP_FREE( buf.data );
261 if ( rc < 0 ) return rc;
263 rc = tlsg_getfile( lt->lt_certfile, &buf );
265 rc = gnutls_x509_crt_list_import( certs, &max, &buf,
266 GNUTLS_X509_FMT_PEM, 0 );
267 LDAP_FREE( buf.data );
268 if ( rc < 0 ) return rc;
270 /* If there's only one cert and it's not self-signed,
271 * then we have to build the cert chain.
273 if ( max == 1 && !gnutls_x509_crt_check_issuer( certs[0], certs[0] )) {
275 for ( i = 1; i<VERIFY_DEPTH; i++ ) {
276 if ( gnutls_certificate_get_issuer( ctx->cred, certs[i-1], &certs[i], 0 ))
279 /* If this CA is self-signed, we're done */
280 if ( gnutls_x509_crt_check_issuer( certs[i], certs[i] ))
284 rc = gnutls_certificate_set_x509_key( ctx->cred, certs, max, key );
286 } else if ( lo->ldo_tls_certfile || lo->ldo_tls_keyfile ) {
287 Debug( LDAP_DEBUG_ANY,
288 "TLS: only one of certfile and keyfile specified\n",
293 if ( lo->ldo_tls_crlfile ) {
294 rc = gnutls_certificate_set_x509_crl_file(
297 GNUTLS_X509_FMT_PEM );
298 if ( rc < 0 ) return -1;
302 /* FIXME: ITS#5992 - this should be configurable,
303 * and V1 CA certs should be phased out ASAP.
305 gnutls_certificate_set_verify_flags( ctx->cred,
306 GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT );
308 if ( is_server && lo->ldo_tls_dhfile ) {
310 rc = tlsg_getfile( lo->ldo_tls_dhfile, &buf );
312 rc = gnutls_dh_params_init( &ctx->dh_params );
314 rc = gnutls_dh_params_import_pkcs3( ctx->dh_params, &buf,
315 GNUTLS_X509_FMT_PEM );
316 LDAP_FREE( buf.data );
318 gnutls_certificate_set_dh_params( ctx->cred, ctx->dh_params );
321 ctx->reqcert = lo->ldo_tls_require_cert;
327 tlsg_session_new ( tls_ctx * ctx, int is_server )
329 tlsg_ctx *c = (tlsg_ctx *)ctx;
330 tlsg_session *session;
332 session = ber_memcalloc ( 1, sizeof (*session) );
337 gnutls_init( &session->session, is_server ? GNUTLS_SERVER : GNUTLS_CLIENT );
338 gnutls_priority_set( session->session, c->prios );
340 gnutls_credentials_set( session->session, GNUTLS_CRD_CERTIFICATE, c->cred );
345 flag = GNUTLS_CERT_REQUEST;
346 if ( c->reqcert == LDAP_OPT_X_TLS_DEMAND ||
347 c->reqcert == LDAP_OPT_X_TLS_HARD )
348 flag = GNUTLS_CERT_REQUIRE;
349 gnutls_certificate_server_set_request( session->session, flag );
352 return (tls_session *)session;
356 tlsg_session_accept( tls_session *session )
358 tlsg_session *s = (tlsg_session *)session;
361 rc = gnutls_handshake( s->session );
362 if ( rc == 0 && s->ctx->reqcert != LDAP_OPT_X_TLS_NEVER ) {
363 const gnutls_datum_t *peer_cert_list;
364 unsigned int list_size;
366 peer_cert_list = gnutls_certificate_get_peers( s->session,
368 if ( !peer_cert_list && s->ctx->reqcert == LDAP_OPT_X_TLS_TRY )
371 rc = tlsg_cert_verify( s );
372 if ( rc && s->ctx->reqcert == LDAP_OPT_X_TLS_ALLOW )
380 tlsg_session_connect( LDAP *ld, tls_session *session )
382 return tlsg_session_accept( session);
386 tlsg_session_upflags( Sockbuf *sb, tls_session *session, int rc )
388 tlsg_session *s = (tlsg_session *)session;
390 if ( rc != GNUTLS_E_INTERRUPTED && rc != GNUTLS_E_AGAIN )
393 switch (gnutls_record_get_direction (s->session)) {
395 sb->sb_trans_needs_read = 1;
398 sb->sb_trans_needs_write = 1;
405 tlsg_session_errmsg( tls_session *sess, int rc, char *buf, size_t len )
407 return (char *)gnutls_strerror( rc );
411 tlsg_x509_cert_dn( struct berval *cert, struct berval *dn, int get_subject )
413 BerElementBuffer berbuf;
414 BerElement *ber = (BerElement *)&berbuf;
419 ber_init2( ber, cert, LBER_USE_DER );
420 tag = ber_skip_tag( ber, &len ); /* Sequence */
421 tag = ber_skip_tag( ber, &len ); /* Sequence */
422 tag = ber_peek_tag( ber, &len ); /* Context + Constructed (version) */
423 if ( tag == 0xa0 ) { /* Version is optional */
424 tag = ber_skip_tag( ber, &len );
425 tag = ber_get_int( ber, &i ); /* Int: Version */
427 tag = ber_skip_tag( ber, &len ); /* Int: Serial (can be longer than ber_int_t) */
428 ber_skip_data( ber, len );
429 tag = ber_skip_tag( ber, &len ); /* Sequence: Signature */
430 ber_skip_data( ber, len );
431 if ( !get_subject ) {
432 tag = ber_peek_tag( ber, &len ); /* Sequence: Issuer DN */
434 tag = ber_skip_tag( ber, &len );
435 ber_skip_data( ber, len );
436 tag = ber_skip_tag( ber, &len ); /* Sequence: Validity */
437 ber_skip_data( ber, len );
438 tag = ber_peek_tag( ber, &len ); /* Sequence: Subject DN */
440 len = ber_ptrlen( ber );
441 dn->bv_val = cert->bv_val + len;
442 dn->bv_len = cert->bv_len - len;
446 tlsg_session_my_dn( tls_session *session, struct berval *der_dn )
448 tlsg_session *s = (tlsg_session *)session;
449 const gnutls_datum_t *x;
452 x = gnutls_certificate_get_ours( s->session );
454 if (!x) return LDAP_INVALID_CREDENTIALS;
456 bv.bv_val = (char *) x->data;
459 tlsg_x509_cert_dn( &bv, der_dn, 1 );
464 tlsg_session_peer_dn( tls_session *session, struct berval *der_dn )
466 tlsg_session *s = (tlsg_session *)session;
467 if ( !s->peer_der_dn.bv_val ) {
468 const gnutls_datum_t *peer_cert_list;
469 unsigned int list_size;
472 peer_cert_list = gnutls_certificate_get_peers( s->session,
474 if ( !peer_cert_list ) return LDAP_INVALID_CREDENTIALS;
476 bv.bv_len = peer_cert_list->size;
477 bv.bv_val = (char *) peer_cert_list->data;
479 tlsg_x509_cert_dn( &bv, &s->peer_der_dn, 1 );
481 *der_dn = s->peer_der_dn;
485 /* what kind of hostname were we given? */
490 #define CN_OID "2.5.4.3"
493 tlsg_session_chkhost( LDAP *ld, tls_session *session, const char *name_in )
495 tlsg_session *s = (tlsg_session *)session;
497 const gnutls_datum_t *peer_cert_list;
498 unsigned int list_size;
499 char altname[NI_MAXHOST];
502 gnutls_x509_crt_t cert;
507 struct in6_addr addr;
511 int len1 = 0, len2 = 0;
514 if( ldap_int_hostname &&
515 ( !name_in || !strcasecmp( name_in, "localhost" ) ) )
517 name = ldap_int_hostname;
522 peer_cert_list = gnutls_certificate_get_peers( s->session,
524 if ( !peer_cert_list ) {
525 Debug( LDAP_DEBUG_ANY,
526 "TLS: unable to get peer certificate.\n",
528 /* If this was a fatal condition, things would have
529 * aborted long before now.
533 ret = gnutls_x509_crt_init( &cert );
535 return LDAP_LOCAL_ERROR;
536 ret = gnutls_x509_crt_import( cert, peer_cert_list, GNUTLS_X509_FMT_DER );
538 gnutls_x509_crt_deinit( cert );
539 return LDAP_LOCAL_ERROR;
543 if (inet_pton(AF_INET6, name, &addr)) {
547 if ((ptr = strrchr(name, '.')) && isdigit((unsigned char)ptr[1])) {
548 if (inet_aton(name, (struct in_addr *)&addr)) ntype = IS_IP4;
551 if (ntype == IS_DNS) {
553 domain = strchr(name, '.');
555 len2 = len1 - (domain-name);
559 for ( i=0, ret=0; ret >= 0; i++ ) {
560 altnamesize = sizeof(altname);
561 ret = gnutls_x509_crt_get_subject_alt_name( cert, i,
562 altname, &altnamesize, NULL );
563 if ( ret < 0 ) break;
566 if ( altnamesize == 0 ) continue;
568 if ( ret == GNUTLS_SAN_DNSNAME ) {
569 if (ntype != IS_DNS) continue;
571 /* Is this an exact match? */
572 if ((len1 == altnamesize) && !strncasecmp(name, altname, len1)) {
576 /* Is this a wildcard match? */
577 if (domain && (altname[0] == '*') && (altname[1] == '.') &&
578 (len2 == altnamesize-1) && !strncasecmp(domain, &altname[1], len2))
582 } else if ( ret == GNUTLS_SAN_IPADDRESS ) {
583 if (ntype == IS_DNS) continue;
586 if (ntype == IS_IP6 && altnamesize != sizeof(struct in6_addr)) {
590 if (ntype == IS_IP4 && altnamesize != sizeof(struct in_addr)) {
593 if (!memcmp(altname, &addr, altnamesize)) {
601 /* find the last CN */
605 ret = gnutls_x509_crt_get_dn_by_oid( cert, CN_OID,
606 i, 1, altname, &altnamesize );
607 if ( ret == GNUTLS_E_SHORT_MEMORY_BUFFER )
614 altnamesize = sizeof(altname);
615 ret = gnutls_x509_crt_get_dn_by_oid( cert, CN_OID,
616 i-1, 0, altname, &altnamesize );
620 Debug( LDAP_DEBUG_ANY,
621 "TLS: unable to get common name from peer certificate.\n",
623 ret = LDAP_CONNECT_ERROR;
624 if ( ld->ld_error ) {
625 LDAP_FREE( ld->ld_error );
627 ld->ld_error = LDAP_STRDUP(
628 _("TLS: unable to get CN from peer certificate"));
631 ret = LDAP_LOCAL_ERROR;
632 if ( !len1 ) len1 = strlen( name );
633 if ( len1 == altnamesize && strncasecmp(name, altname, altnamesize) == 0 ) {
636 } else if (( altname[0] == '*' ) && ( altname[1] == '.' )) {
637 /* Is this a wildcard match? */
639 (len2 == altnamesize-1) && !strncasecmp(domain, &altname[1], len2)) {
645 if( ret == LDAP_LOCAL_ERROR ) {
646 altname[altnamesize] = '\0';
647 Debug( LDAP_DEBUG_ANY, "TLS: hostname (%s) does not match "
648 "common name in certificate (%s).\n",
650 ret = LDAP_CONNECT_ERROR;
651 if ( ld->ld_error ) {
652 LDAP_FREE( ld->ld_error );
654 ld->ld_error = LDAP_STRDUP(
655 _("TLS: hostname does not match CN in peer certificate"));
658 gnutls_x509_crt_deinit( cert );
663 tlsg_session_strength( tls_session *session )
665 tlsg_session *s = (tlsg_session *)session;
666 gnutls_cipher_algorithm_t c;
668 c = gnutls_cipher_get( s->session );
669 return gnutls_cipher_get_key_size( c ) * 8;
673 tlsg_session_unique( tls_session *sess, struct berval *buf, int is_server)
675 tlsg_session *s = (tlsg_session *)sess;
679 rc = gnutls_session_channel_binding( s->session, GNUTLS_CB_TLS_UNIQUE, &cb );
682 if ( len > buf->bv_len )
685 memcpy( buf->bv_val, cb.data, len );
692 tlsg_session_version( tls_session *sess )
694 tlsg_session *s = (tlsg_session *)sess;
695 return gnutls_protocol_get_name(gnutls_protocol_get_version( s->session ));
699 tlsg_session_cipher( tls_session *sess )
701 tlsg_session *s = (tlsg_session *)sess;
702 return gnutls_cipher_get_name(gnutls_cipher_get( s->session ));
706 tlsg_session_peercert( tls_session *sess, struct berval *der )
708 tlsg_session *s = (tlsg_session *)sess;
709 const gnutls_datum_t *peer_cert_list;
710 unsigned int list_size;
712 peer_cert_list = gnutls_certificate_get_peers( s->session, &list_size );
715 der->bv_len = peer_cert_list[0].size;
716 der->bv_val = LDAP_MALLOC( der->bv_len );
719 memcpy(der->bv_val, peer_cert_list[0].data, der->bv_len);
723 /* suites is a string of colon-separated cipher suite names. */
725 tlsg_parse_ciphers( tlsg_ctx *ctx, char *suites )
728 int rc = gnutls_priority_init( &ctx->prios, suites, &err );
735 * TLS support for LBER Sockbufs
739 tlsg_session *session;
740 Sockbuf_IO_Desc *sbiod;
744 tlsg_recv( gnutls_transport_ptr_t ptr, void *buf, size_t len )
748 if ( buf == NULL || len <= 0 ) return 0;
750 p = (struct tls_data *)ptr;
752 if ( p == NULL || p->sbiod == NULL ) {
756 return LBER_SBIOD_READ_NEXT( p->sbiod, buf, len );
760 tlsg_send( gnutls_transport_ptr_t ptr, const void *buf, size_t len )
764 if ( buf == NULL || len <= 0 ) return 0;
766 p = (struct tls_data *)ptr;
768 if ( p == NULL || p->sbiod == NULL ) {
772 return LBER_SBIOD_WRITE_NEXT( p->sbiod, (char *)buf, len );
776 tlsg_sb_setup( Sockbuf_IO_Desc *sbiod, void *arg )
779 tlsg_session *session = arg;
781 assert( sbiod != NULL );
783 p = LBER_MALLOC( sizeof( *p ) );
788 gnutls_transport_set_ptr( session->session, (gnutls_transport_ptr)p );
789 gnutls_transport_set_pull_function( session->session, tlsg_recv );
790 gnutls_transport_set_push_function( session->session, tlsg_send );
791 p->session = session;
793 sbiod->sbiod_pvt = p;
798 tlsg_sb_remove( Sockbuf_IO_Desc *sbiod )
802 assert( sbiod != NULL );
803 assert( sbiod->sbiod_pvt != NULL );
805 p = (struct tls_data *)sbiod->sbiod_pvt;
806 gnutls_deinit ( p->session->session );
807 LBER_FREE( p->session );
808 LBER_FREE( sbiod->sbiod_pvt );
809 sbiod->sbiod_pvt = NULL;
814 tlsg_sb_close( Sockbuf_IO_Desc *sbiod )
818 assert( sbiod != NULL );
819 assert( sbiod->sbiod_pvt != NULL );
821 p = (struct tls_data *)sbiod->sbiod_pvt;
822 gnutls_bye ( p->session->session, GNUTLS_SHUT_WR );
827 tlsg_sb_ctrl( Sockbuf_IO_Desc *sbiod, int opt, void *arg )
831 assert( sbiod != NULL );
832 assert( sbiod->sbiod_pvt != NULL );
834 p = (struct tls_data *)sbiod->sbiod_pvt;
836 if ( opt == LBER_SB_OPT_GET_SSL ) {
837 *((tlsg_session **)arg) = p->session;
840 } else if ( opt == LBER_SB_OPT_DATA_READY ) {
841 if( gnutls_record_check_pending( p->session->session ) > 0 ) {
846 return LBER_SBIOD_CTRL_NEXT( sbiod, opt, arg );
850 tlsg_sb_read( Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len)
855 assert( sbiod != NULL );
856 assert( SOCKBUF_VALID( sbiod->sbiod_sb ) );
858 p = (struct tls_data *)sbiod->sbiod_pvt;
860 ret = gnutls_record_recv ( p->session->session, buf, len );
862 case GNUTLS_E_INTERRUPTED:
864 sbiod->sbiod_sb->sb_trans_needs_read = 1;
865 sock_errset(EWOULDBLOCK);
868 case GNUTLS_E_REHANDSHAKE:
869 for ( ret = gnutls_handshake ( p->session->session );
870 ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN;
871 ret = gnutls_handshake ( p->session->session ) );
872 sbiod->sbiod_sb->sb_trans_needs_read = 1;
876 sbiod->sbiod_sb->sb_trans_needs_read = 0;
882 tlsg_sb_write( Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t len)
887 assert( sbiod != NULL );
888 assert( SOCKBUF_VALID( sbiod->sbiod_sb ) );
890 p = (struct tls_data *)sbiod->sbiod_pvt;
892 ret = gnutls_record_send ( p->session->session, (char *)buf, len );
894 if ( ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN ) {
895 sbiod->sbiod_sb->sb_trans_needs_write = 1;
896 sock_errset(EWOULDBLOCK);
899 sbiod->sbiod_sb->sb_trans_needs_write = 0;
904 static Sockbuf_IO tlsg_sbio =
906 tlsg_sb_setup, /* sbi_setup */
907 tlsg_sb_remove, /* sbi_remove */
908 tlsg_sb_ctrl, /* sbi_ctrl */
909 tlsg_sb_read, /* sbi_read */
910 tlsg_sb_write, /* sbi_write */
911 tlsg_sb_close /* sbi_close */
914 /* Certs are not automatically varified during the handshake */
916 tlsg_cert_verify( tlsg_session *ssl )
918 unsigned int status = 0;
920 time_t now = time(0);
923 err = gnutls_certificate_verify_peers2( ssl->session, &status );
925 Debug( LDAP_DEBUG_ANY,"TLS: gnutls_certificate_verify_peers2 failed %d\n",
930 Debug( LDAP_DEBUG_TRACE,"TLS: peer cert untrusted or revoked (0x%x)\n",
934 peertime = gnutls_certificate_expiration_time_peers( ssl->session );
935 if ( peertime == (time_t) -1 ) {
936 Debug( LDAP_DEBUG_ANY, "TLS: gnutls_certificate_expiration_time_peers failed\n",
940 if ( peertime < now ) {
941 Debug( LDAP_DEBUG_ANY, "TLS: peer certificate is expired\n",
945 peertime = gnutls_certificate_activation_time_peers( ssl->session );
946 if ( peertime == (time_t) -1 ) {
947 Debug( LDAP_DEBUG_ANY, "TLS: gnutls_certificate_activation_time_peers failed\n",
951 if ( peertime > now ) {
952 Debug( LDAP_DEBUG_ANY, "TLS: peer certificate not yet active\n",
959 tls_impl ldap_int_tls_impl = {
971 tlsg_session_connect,
973 tlsg_session_upflags,
976 tlsg_session_peer_dn,
977 tlsg_session_chkhost,
978 tlsg_session_strength,
980 tlsg_session_version,
982 tlsg_session_peercert,
986 #ifdef LDAP_R_COMPILE
995 #endif /* HAVE_GNUTLS */