tls: add accessor to OpenSSL context (ref #35) (#46)

This commit is contained in:
Alfred E. Heggestad 2017-03-07 08:36:14 +01:00 committed by Richard Aas
parent 334ec75011
commit 068b9ab8b8
2 changed files with 20 additions and 0 deletions

View file

@ -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

View file

@ -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;
}