mirror of
https://github.com/haproxy/haproxy.git
synced 2026-03-26 20:33:29 -04:00
MINOR: ssl: add a new function ssl_sock_get_ssl_object()
This one can be used later to get a SSL object from connection. It will return NULL if connection is not established over SSL.
This commit is contained in:
parent
9ac9809cb9
commit
eb607fe6a1
2 changed files with 10 additions and 0 deletions
|
|
@ -109,6 +109,8 @@ void ssl_async_fd_free(int fd);
|
|||
*/
|
||||
int ssl_sock_register_msg_callback(ssl_sock_msg_callback_func func);
|
||||
|
||||
SSL *ssl_sock_get_ssl_object(struct connection *conn);
|
||||
|
||||
#endif /* USE_OPENSSL */
|
||||
#endif /* _PROTO_SSL_SOCK_H */
|
||||
|
||||
|
|
|
|||
|
|
@ -695,6 +695,14 @@ static void ssl_sock_unregister_msg_callbacks(void)
|
|||
}
|
||||
}
|
||||
|
||||
SSL *ssl_sock_get_ssl_object(struct connection *conn)
|
||||
{
|
||||
if (!ssl_sock_is_ssl(conn))
|
||||
return NULL;
|
||||
|
||||
return ((struct ssl_sock_ctx *)(conn->xprt_ctx))->ssl;
|
||||
}
|
||||
|
||||
/*
|
||||
* This function gives the detail of the SSL error. It is used only
|
||||
* if the debug mode and the verbose mode are activated. It dump all
|
||||
|
|
|
|||
Loading…
Reference in a new issue