summaryrefslogtreecommitdiffstats
path: root/src/plugins/tlsopenssl/tls_openssl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/tlsopenssl/tls_openssl.c')
-rw-r--r--src/plugins/tlsopenssl/tls_openssl.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/plugins/tlsopenssl/tls_openssl.c b/src/plugins/tlsopenssl/tls_openssl.c
index d99a89c3d9c..976ccb4e062 100644
--- a/src/plugins/tlsopenssl/tls_openssl.c
+++ b/src/plugins/tlsopenssl/tls_openssl.c
@@ -58,6 +58,7 @@ openssl_ctx_free (tls_ctx_t * ctx)
SSL_free (oc->ssl);
+ vec_free (ctx->srv_hostname);
pool_put_index (openssl_main.ctx_pool[ctx->c_thread_index],
oc->openssl_ctx_index);
}
@@ -725,6 +726,27 @@ openssl_handshake_is_over (tls_ctx_t * ctx)
return SSL_is_init_finished (mc->ssl);
}
+static int
+openssl_transport_close (tls_ctx_t * ctx)
+{
+ if (!openssl_handshake_is_over (ctx))
+ {
+ session_close (session_get_from_handle (ctx->tls_session_handle));
+ return 0;
+ }
+ session_transport_closing_notify (&ctx->connection);
+ return 0;
+}
+
+static int
+openssl_app_close (tls_ctx_t * ctx)
+{
+ tls_disconnect_transport (ctx);
+ session_transport_delete_notify (&ctx->connection);
+ openssl_ctx_free (ctx);
+ return 0;
+}
+
const static tls_engine_vft_t openssl_engine = {
.ctx_alloc = openssl_ctx_alloc,
.ctx_free = openssl_ctx_free,
@@ -737,6 +759,8 @@ const static tls_engine_vft_t openssl_engine = {
.ctx_handshake_is_over = openssl_handshake_is_over,
.ctx_start_listen = openssl_start_listen,
.ctx_stop_listen = openssl_stop_listen,
+ .ctx_transport_close = openssl_transport_close,
+ .ctx_app_close = openssl_app_close,
};
int