From 617554f305dc3bd031779ba0b8ef8d52edb52edd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 18 Sep 2019 14:03:19 +0200 Subject: Add tests for TLS proxy and TCP/TLS server --- test/socks_SUITE.erl | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/test/socks_SUITE.erl b/test/socks_SUITE.erl index 07b3497..81d4c10 100644 --- a/test/socks_SUITE.erl +++ b/test/socks_SUITE.erl @@ -146,21 +146,37 @@ do_auth_method({username_password, _, _}) -> username_password. socks5_tcp_http_none(_) -> doc("Use Socks5 over TCP and without authentication to connect to an HTTP server."), - do_socks5_tcp_http(<<"http">>, tcp, tcp, none). + do_socks5_http(<<"http">>, tcp, tcp, none). socks5_tcp_http_username_password(_) -> doc("Use Socks5 over TCP and without authentication to connect to an HTTP server."), - do_socks5_tcp_http(<<"http">>, tcp, tcp, {username_password, <<"user">>, <<"password">>}). + do_socks5_http(<<"http">>, tcp, tcp, {username_password, <<"user">>, <<"password">>}). socks5_tcp_https_none(_) -> doc("Use Socks5 over TCP and without authentication to connect to an HTTPS server."), - do_socks5_tcp_http(<<"https">>, tls, tcp, none). + do_socks5_http(<<"https">>, tls, tcp, none). socks5_tcp_https_username_password(_) -> doc("Use Socks5 over TCP and without authentication to connect to an HTTPS server."), - do_socks5_tcp_http(<<"https">>, tls, tcp, {username_password, <<"user">>, <<"password">>}). + do_socks5_http(<<"https">>, tls, tcp, {username_password, <<"user">>, <<"password">>}). -do_socks5_tcp_http(OriginScheme, OriginTransport, ProxyTransport, SocksAuth) -> +socks5_tls_http_none(_) -> + doc("Use Socks5 over TLS and without authentication to connect to an HTTP server."), + do_socks5_http(<<"http">>, tcp, tls, none). + +socks5_tls_http_username_password(_) -> + doc("Use Socks5 over TLS and without authentication to connect to an HTTP server."), + do_socks5_http(<<"http">>, tcp, tls, {username_password, <<"user">>, <<"password">>}). + +socks5_tls_https_none(_) -> + doc("Use Socks5 over TLS and without authentication to connect to an HTTP server."), + do_socks5_http(<<"https">>, tls, tls, none). + +socks5_tls_https_username_password(_) -> + doc("Use Socks5 over TLS and without authentication to connect to an HTTP server."), + do_socks5_http(<<"https">>, tls, tls, {username_password, <<"user">>, <<"password">>}). + +do_socks5_http(OriginScheme, OriginTransport, ProxyTransport, SocksAuth) -> {ok, OriginPid, OriginPort} = init_origin(OriginTransport, http), {ok, ProxyPid, ProxyPort} = do_proxy_start(ProxyTransport, SocksAuth), Authority = iolist_to_binary(["localhost:", integer_to_binary(OriginPort)]), -- cgit v1.2.3