mirror of
https://github.com/proxytunnel/proxytunnel.git
synced 2026-01-23 02:34:59 +00:00
SNI support
add SNI support
This commit is contained in:
parent
988322682f
commit
583d6ac96e
4 changed files with 14 additions and 10 deletions
17
ptstream.c
17
ptstream.c
|
|
@ -162,18 +162,19 @@ int stream_enable_ssl(PTSTREAM *pts) {
|
|||
ctx = SSL_CTX_new (meth);
|
||||
ssl = SSL_new (ctx);
|
||||
|
||||
SSL_set_rfd (ssl, stream_get_incoming_fd(pts));
|
||||
SSL_set_wfd (ssl, stream_get_outgoing_fd(pts));
|
||||
|
||||
/* SNI support */
|
||||
if ( args_info.verbose_flag ) {
|
||||
message( "Set SNI hostname to %s\n", args_info.proxyhost_arg );
|
||||
}
|
||||
res = SSL_set_tlsext_host_name(ssl,args_info.proxyhost_arg);
|
||||
if (res < 0) {
|
||||
message( "TLS SNI error, giving up: SSL_set_tlsext_host_name returned error message:\n %u\n", res );
|
||||
exit( 1 );
|
||||
}
|
||||
}
|
||||
res = SSL_set_tlsext_host_name(ssl,args_info.proxyhost_arg);
|
||||
if (res < 0) {
|
||||
message( "TLS SNI error, giving up: SSL_set_tlsext_host_name returned error message:\n %u\n", res );
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
SSL_set_rfd (ssl, stream_get_incoming_fd(pts));
|
||||
SSL_set_wfd (ssl, stream_get_outgoing_fd(pts));
|
||||
SSL_connect (ssl);
|
||||
|
||||
/* Store ssl and ctx parameters */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue