aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2019-09-18 14:03:19 +0200
committerLoïc Hoguin <[email protected]>2019-09-22 16:46:35 +0200
commit617554f305dc3bd031779ba0b8ef8d52edb52edd (patch)
treed9e18b9c4c3879b1c8f39c097e17f03d9e5b410d
parent28b24a32b82c6429462569be14e00bec65a850ee (diff)
downloadgun-617554f305dc3bd031779ba0b8ef8d52edb52edd.tar.gz
gun-617554f305dc3bd031779ba0b8ef8d52edb52edd.tar.bz2
gun-617554f305dc3bd031779ba0b8ef8d52edb52edd.zip
Add tests for TLS proxy and TCP/TLS server
-rw-r--r--test/socks_SUITE.erl26
1 files 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)]),