diff --git a/include/re_tls.h b/include/re_tls.h index aeb1961..aa45f60 100644 --- a/include/re_tls.h +++ b/include/re_tls.h @@ -90,3 +90,10 @@ void dtls_set_handlers(struct tls_conn *tc, dtls_estab_h *estabh, dtls_recv_h *recvh, dtls_close_h *closeh, void *arg); const struct sa *dtls_peer(const struct tls_conn *tc); void dtls_set_peer(struct tls_conn *tc, const struct sa *peer); + + +#ifdef USE_OPENSSL +struct ssl_ctx_st; + +struct ssl_ctx_st *tls_openssl_context(const struct tls *tls); +#endif diff --git a/src/tls/openssl/tls.c b/src/tls/openssl/tls.c index 3fd85ec..c82d937 100644 --- a/src/tls/openssl/tls.c +++ b/src/tls/openssl/tls.c @@ -889,3 +889,16 @@ void tls_flush_error(void) { ERR_print_errors_cb(print_error, NULL); } + + +/** + * Get the backend-specific (OpenSSL) context + * + * @param tls Generic TLS Context + * + * @return OpenSSL context + */ +struct ssl_ctx_st *tls_openssl_context(const struct tls *tls) +{ + return tls ? tls->ctx : NULL; +}