diff options
author | Ingela Anderton Andin <[email protected]> | 2012-09-12 17:36:19 +0200 |
---|---|---|
committer | Raimo Niskanen <[email protected]> | 2012-10-02 09:25:02 +0200 |
commit | 9c85ee8b61c24587a228b3644c37b1b4fdfb7dcb (patch) | |
tree | 46a3a6296444482609d628538e2280a14f8db958 /lib/inets/src/http_client/httpc.erl | |
parent | 9880ff4e299269055ddbdf2e0332737099a2bcfd (diff) | |
download | otp-9c85ee8b61c24587a228b3644c37b1b4fdfb7dcb.tar.gz otp-9c85ee8b61c24587a228b3644c37b1b4fdfb7dcb.tar.bz2 otp-9c85ee8b61c24587a228b3644c37b1b4fdfb7dcb.zip |
inets httpc: TLS via proxy
Introduces new option htts_proxy so that it is possible
to have different proxies for http and https. The new option
defaults to the old proxy option.
Implements HTTP-1.1 extension method CONNECT to establish SSL/TLS tunnel
We choose not to implement "TLS upgrade" as defined by RFC 2817 as
this method of upgrade is vulnerable to man in the middle attacks,
can be easily broken by proxies and does not seem to be widely adopted.
Diffstat (limited to 'lib/inets/src/http_client/httpc.erl')
-rw-r--r-- | lib/inets/src/http_client/httpc.erl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/inets/src/http_client/httpc.erl b/lib/inets/src/http_client/httpc.erl index b6e7708353..ede649a5a9 100644 --- a/lib/inets/src/http_client/httpc.erl +++ b/lib/inets/src/http_client/httpc.erl @@ -917,6 +917,10 @@ validate_options([{proxy, Proxy} = Opt| Tail], Acc) -> validate_proxy(Proxy), validate_options(Tail, [Opt | Acc]); +validate_options([{https_proxy, Proxy} = Opt| Tail], Acc) -> + validate_https_proxy(Proxy), + validate_options(Tail, [Opt | Acc]); + validate_options([{max_sessions, Value} = Opt| Tail], Acc) -> validate_max_sessions(Value), validate_options(Tail, [Opt | Acc]); @@ -979,6 +983,14 @@ validate_proxy({{ProxyHost, ProxyPort}, NoProxy} = Proxy) validate_proxy(BadProxy) -> bad_option(proxy, BadProxy). +validate_https_proxy({{ProxyHost, ProxyPort}, NoProxy} = Proxy) + when is_list(ProxyHost) andalso + is_integer(ProxyPort) andalso + is_list(NoProxy) -> + Proxy; +validate_https_proxy(BadProxy) -> + bad_option(https_proxy, BadProxy). + validate_max_sessions(Value) when is_integer(Value) andalso (Value >= 0) -> Value; validate_max_sessions(BadValue) -> |