aboutsummaryrefslogtreecommitdiffstats
path: root/test/req_SUITE.erl
diff options
context:
space:
mode:
Diffstat (limited to 'test/req_SUITE.erl')
-rw-r--r--test/req_SUITE.erl32
1 files changed, 31 insertions, 1 deletions
diff --git a/test/req_SUITE.erl b/test/req_SUITE.erl
index 3b32b3a..26ced62 100644
--- a/test/req_SUITE.erl
+++ b/test/req_SUITE.erl
@@ -134,6 +134,30 @@ bindings(Config) ->
<<"#{key => <<\"bindings\">>}">> = do_get_body("/bindings", Config),
ok.
+cert(Config) ->
+ case config(type, Config) of
+ tcp -> doc("TLS certificates can only be provided over TLS.");
+ ssl -> do_cert(Config)
+ end.
+
+do_cert(Config0) ->
+ doc("A client TLS certificate was provided."),
+ {CaCert, Cert, Key} = ct_helper:make_certs(),
+ Config = [{transport_opts, [
+ {cert, Cert},
+ {key, Key},
+ {cacerts, [CaCert]}
+ ]}|Config0],
+ Cert = do_get_body("/cert", Config),
+ Cert = do_get_body("/direct/cert", Config),
+ ok.
+
+cert_undefined(Config) ->
+ doc("No client TLS certificate was provided."),
+ <<"undefined">> = do_get_body("/cert", Config),
+ <<"undefined">> = do_get_body("/direct/cert", Config),
+ ok.
+
header(Config) ->
doc("Request header with/without default."),
<<"value">> = do_get_body("/args/header/defined", [{<<"defined">>, "value"}], Config),
@@ -274,7 +298,7 @@ path_info(Config) ->
ok.
peer(Config) ->
- doc("Request peer."),
+ doc("Remote socket address."),
<<"{{127,0,0,1},", _/bits >> = do_get_body("/peer", Config),
<<"{{127,0,0,1},", _/bits >> = do_get_body("/direct/peer", Config),
ok.
@@ -309,6 +333,12 @@ do_scheme(Path, Config) ->
<<"https">> when Transport =:= ssl -> ok
end.
+sock(Config) ->
+ doc("Local socket address."),
+ <<"{{127,0,0,1},", _/bits >> = do_get_body("/sock", Config),
+ <<"{{127,0,0,1},", _/bits >> = do_get_body("/direct/sock", Config),
+ ok.
+
uri(Config) ->
doc("Request URI building/modification."),
Scheme = case config(type, Config) of