+ if ( slap_controls_init( ) != 0 ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG( OPERATION, CRIT, "main: controls initialization error\n", 0, 0, 0 );
+#else
+ Debug( LDAP_DEBUG_ANY,
+ "controls initialization error\n",
+ 0, 0, 0 );
+#endif
+
+ goto destroy;
+ }
+
+#ifdef HAVE_TLS
+ /* Library defaults to full certificate checking. This is correct when
+ * a client is verifying a server because all servers should have a
+ * valid cert. But few clients have valid certs, so we want our default
+ * to be no checking. The config file can override this as usual.
+ */
+ rc = 0;
+ (void) ldap_pvt_tls_set_option( NULL, LDAP_OPT_X_TLS_REQUIRE_CERT, &rc );
+#endif
+
+#ifdef LDAP_SLAPI
+ if ( slapi_init() != 0 ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG( OPERATION, CRIT, "main: slapi initialization error\n", 0, 0, 0 );
+#else
+ Debug( LDAP_DEBUG_ANY,
+ "slapi initialization error\n",
+ 0, 0, 0 );
+#endif
+
+ goto destroy;
+ }
+#endif /* LDAP_SLAPI */
+
+ if ( read_config( configfile, 0 ) != 0 ) {