ssl policy增加调试输出。

This commit is contained in:
zhengchao
2019-06-14 18:58:03 +08:00
parent 39c84b0bbd
commit b2eb88a7ad
3 changed files with 29 additions and 2 deletions

View File

@@ -2174,4 +2174,21 @@ int ssl_stream_get_integer_opt(struct ssl_stream *upstream, enum SSL_STREAM_OPT
return 0;
}
int ssl_stream_get_string_opt(struct ssl_stream *upstream, enum SSL_STREAM_OPT opt_type, char* in_buff, size_t sz)
{
const char* sni=upstream->up_parts.client_hello->sni?upstream->up_parts.client_hello->sni:"null";
switch(opt_type)
{
case SSL_STREAM_OPT_SNI:
strncpy(in_buff, sni, sz);
break;
case SSL_STREAM_OPT_ADDR:
strncpy(in_buff, upstream->tcp_stream->str_stream_info, sz);
break;
default:
assert(0);
return -1;
}
return 0;
}