+ olc_index = openssl_listen_ctx_alloc ();
+ olc = openssl_lctx_get (olc_index);
+ olc->ssl_ctx = ssl_ctx;
+ olc->srvcert = srvcert;
+ olc->pkey = pkey;
+
+ /* store SSL_CTX into TLS level structure */
+ lctx->tls_ssl_ctx = olc_index;
+
+ return 0;
+
+}
+
+static int
+openssl_stop_listen (tls_ctx_t * lctx)
+{
+ u32 olc_index;
+ openssl_listen_ctx_t *olc;
+
+ olc_index = lctx->tls_ssl_ctx;
+ olc = openssl_lctx_get (olc_index);
+
+ X509_free (olc->srvcert);
+ EVP_PKEY_free (olc->pkey);
+
+ SSL_CTX_free (olc->ssl_ctx);
+ openssl_listen_ctx_free (olc);
+
+ return 0;
+}
+
+static int
+openssl_ctx_init_server (tls_ctx_t * ctx)
+{
+ openssl_ctx_t *oc = (openssl_ctx_t *) ctx;
+ u32 olc_index = ctx->tls_ssl_ctx;
+ openssl_listen_ctx_t *olc;
+ stream_session_t *tls_session;
+ int rv, err;
+#ifdef HAVE_OPENSSL_ASYNC
+ openssl_resume_handler *handler;
+#endif
+