]> git.sur5r.net Git - openldap/blobdiff - servers/slurpd/main.c
don't leak matchedDN
[openldap] / servers / slurpd / main.c
index 4984a6a50f8da9e4a9f34019a61fd959eb2c52d7..ccd75e7ed0398f6227fea53a7c2c87289fb394e4 100644 (file)
@@ -156,10 +156,20 @@ int main( int argc, char **argv )
 
 #ifdef HAVE_TLS
        if( ldap_pvt_tls_init() || ldap_pvt_tls_init_def_ctx() ) {
-               fprintf( stderr, "TLS Initialization failed.\n" );
-               SERVICE_EXIT( ERROR_SERVICE_SPECIFIC_ERROR, 20 );
-               rc = 1;
-               goto stop;
+               rc = 0;
+               /* See if we actually need TLS */
+               for ( i=0; i < sglob->num_replicas; i++ ) {
+                       if ( sglob->replicas[i]->ri_tls || ( sglob->replicas[i]->ri_uri &&
+                               !strncmp( sglob->replicas[i]->ri_uri, "ldaps:", 6 ))) {
+                               rc = 1;
+                               break;
+                       }
+               }
+               if ( rc ) {
+                       fprintf( stderr, "TLS Initialization failed.\n" );
+                       SERVICE_EXIT( ERROR_SERVICE_SPECIFIC_ERROR, 20 );
+                       goto stop;
+               }
        }
 #endif