Always get the "certs" index for SSL.
authorAlan T. DeKok <aland@freeradius.org>
Tue, 2 Dec 2014 18:54:23 +0000 (13:54 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 2 Dec 2014 18:54:23 +0000 (13:54 -0500)
src/main/tls.c

index ff4c572..7e15291 100644 (file)
@@ -2113,6 +2113,11 @@ void tls_global_init(void)
        SSL_library_init();             /* initialize library */
        OpenSSL_add_all_algorithms();   /* required for SHA2 in OpenSSL < 0.9.8o and 1.0.0.a */
        OPENSSL_config(NULL);
+
+       /*
+        *      Initialize the index for the certificates.
+        */
+       fr_tls_ex_index_certs = SSL_SESSION_get_ex_new_index(0, NULL, NULL, NULL, sess_free_certs);
 }
 
 #ifdef ENABLE_OPENSSL_VERSION_CHECK
@@ -2486,8 +2491,6 @@ post_ca:
                SSL_CTX_set_quiet_shutdown(ctx, 1);
                if (fr_tls_ex_index_vps < 0)
                        fr_tls_ex_index_vps = SSL_SESSION_get_ex_new_index(0, NULL, NULL, NULL, sess_free_vps);
-               if (fr_tls_ex_index_certs < 0)
-                       fr_tls_ex_index_certs = SSL_SESSION_get_ex_new_index(0, NULL, NULL, NULL, sess_free_certs);
        }
 
        /*