增加ssl_stream_dump_info函数,输出ssl版本号、sni,以进一步定位 #116
This commit is contained in:
@@ -22,8 +22,7 @@ struct bufferevent * ssl_downstream_create_result_release_bev(future_result_t *
|
|||||||
void ssl_async_downstream_create(struct future * f, struct ssl_mgr * mgr, struct ssl_stream * upstream,
|
void ssl_async_downstream_create(struct future * f, struct ssl_mgr * mgr, struct ssl_stream * upstream,
|
||||||
evutil_socket_t fd_downstream, int keyring_id, unsigned int thread_id);
|
evutil_socket_t fd_downstream, int keyring_id, unsigned int thread_id);
|
||||||
void ssl_stream_free_and_close_fd(struct ssl_stream * stream, struct event_base * evbase, evutil_socket_t fd);
|
void ssl_stream_free_and_close_fd(struct ssl_stream * stream, struct event_base * evbase, evutil_socket_t fd);
|
||||||
void ssl_stream_log_error(struct bufferevent * bev, enum tfe_conn_dir dir, void* logger);
|
const char* ssl_stream_dump_info(struct ssl_stream *stream, char* buffer, size_t sz);
|
||||||
|
|
||||||
//Follow functions are allowed to call during runtime.
|
//Follow functions are allowed to call during runtime.
|
||||||
int ssl_manager_add_trust_ca(struct ssl_mgr* mgr, const char* pem_file);
|
int ssl_manager_add_trust_ca(struct ssl_mgr* mgr, const char* pem_file);
|
||||||
int ssl_manager_del_trust_ca(struct ssl_mgr* mgr, const char* pem_file);
|
int ssl_manager_del_trust_ca(struct ssl_mgr* mgr, const char* pem_file);
|
||||||
|
|||||||
@@ -886,6 +886,12 @@ struct bufferevent * ssl_upstream_create_result_release_bev(future_result_t * re
|
|||||||
ctx->bev = NULL; //giveup ownership
|
ctx->bev = NULL; //giveup ownership
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
const char* ssl_stream_dump_info(struct ssl_stream *stream, char* buffer, size_t sz)
|
||||||
|
{
|
||||||
|
snprintf(buffer, sz, "%s:%s", SSL_get_version(stream->ssl),
|
||||||
|
stream->dir==CONN_DIR_UPSTREAM ? stream->client_hello->sni:NULL);
|
||||||
|
return buffer;
|
||||||
|
}
|
||||||
void ssl_stream_log_error(struct bufferevent * bev, enum tfe_conn_dir dir, struct ssl_mgr* mgr)
|
void ssl_stream_log_error(struct bufferevent * bev, enum tfe_conn_dir dir, struct ssl_mgr* mgr)
|
||||||
{
|
{
|
||||||
unsigned long sslerr=0;
|
unsigned long sslerr=0;
|
||||||
|
|||||||
Reference in New Issue
Block a user