diff options
author | Fredrik Gustafsson <[email protected]> | 2013-08-23 16:28:41 +0200 |
---|---|---|
committer | Fredrik Gustafsson <[email protected]> | 2013-08-23 16:28:41 +0200 |
commit | 614816910235c0941b2f36da520610e777b35fc3 (patch) | |
tree | 80f208bac66743778c2a48c3a2e03e1d7be8d553 /lib/inets/src/http_lib | |
parent | 5f9c7987b3f4b34c4028783dc0f3f1c6c903d6ab (diff) | |
parent | c72b20183a780c7199d3959f09eb88c1a930a064 (diff) | |
download | otp-614816910235c0941b2f36da520610e777b35fc3.tar.gz otp-614816910235c0941b2f36da520610e777b35fc3.tar.bz2 otp-614816910235c0941b2f36da520610e777b35fc3.zip |
Merge branch 'maint-r15' into maint-r16
Conflicts:
lib/inets/doc/src/notes.xml
lib/inets/src/http_lib/http_transport.erl
lib/inets/src/inets_app/inets.appup.src
lib/inets/vsn.mk
lib/ssl/doc/src/notes.xml
lib/ssl/src/ssl.appup.src
lib/ssl/src/ssl.erl
lib/ssl/src/ssl_internal.hrl
lib/ssl/src/tls_connection.erl
lib/ssl/vsn.mk
Diffstat (limited to 'lib/inets/src/http_lib')
-rw-r--r-- | lib/inets/src/http_lib/http_transport.erl | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/lib/inets/src/http_lib/http_transport.erl b/lib/inets/src/http_lib/http_transport.erl index df58fa1b81..7e679531cf 100644 --- a/lib/inets/src/http_lib/http_transport.erl +++ b/lib/inets/src/http_lib/http_transport.erl @@ -159,7 +159,7 @@ listen(ip_comm = _SocketType, Addr, Port, Fd, IpFamily) -> listen_ip_comm(Addr, Port, Fd, IpFamily); listen({essl, SSLConfig}, Addr, Port, Fd, IpFamily) -> - listen_ssl(Addr, Port, Fd, SSLConfig, IpFamily). + listen_ssl(Addr, Port, Fd, SSLConfig, IpFamily, []). listen(ip_comm = _SocketType, Addr, Port, IpFamily) -> listen_ip_comm(Addr, Port, undefined, IpFamily); @@ -178,7 +178,13 @@ listen({essl, SSLConfig}, Addr, Port, IpFamily) -> [{addr, Addr}, {port, Port}, {ssl_config, SSLConfig}]), - listen_ssl(Addr, Port, undefined, SSLConfig, IpFamily). + {SSLConfig2, ExtraOpts} = case proplists:get_value(log_alert, SSLConfig, undefined) of + undefined -> + {SSLConfig, []}; + LogAlert -> + {proplists:delete(log_alert, SSLConfig), [{log_alert, LogAlert}]} + end, + listen_ssl(Addr, Port, undefined, SSLConfig2, IpFamily, ExtraOpts). listen_ip_comm(Addr, Port, Fd, IpFamily) -> case (catch do_listen_ip_comm(Addr, Port, Fd, IpFamily)) of @@ -221,24 +227,23 @@ do_listen_ip_comm(Addr, Port, Fd, IpFamily) -> gen_tcp:listen(NewPort, Opts2) end. - -listen_ssl(Addr, Port, Fd, Opts0, IpFamily) -> +listen_ssl(Addr, Port, Fd, Opts0, IpFamily, ExtraOpts) -> {NewPort, SockOpt} = get_socket_info(Addr, Port, Fd), Opts = SockOpt ++ Opts0, case IpFamily of inet6fb4 -> - Opts2 = [inet6 | Opts], + Opts2 = [inet6 | Opts] ++ ExtraOpts, ?hlrt("try ipv6 listen", [{opts, Opts2}]), case (catch ssl:listen(Port, Opts2)) of {error, Reason} when ((Reason =:= nxdomain) orelse (Reason =:= eafnosupport)) -> - Opts3 = [inet | Opts], + Opts3 = [inet | Opts] ++ ExtraOpts, ?hlrt("ipv6 listen failed - try ipv4 instead", [{reason, Reason}, {opts, Opts3}]), ssl:listen(NewPort, Opts3); {'EXIT', Reason} -> - Opts3 = [inet | Opts], + Opts3 = [inet | Opts] ++ ExtraOpts, ?hlrt("ipv6 listen exit - try ipv4 instead", [{reason, Reason}, {opts, Opts3}]), ssl:listen(NewPort, Opts3); @@ -251,7 +256,7 @@ listen_ssl(Addr, Port, Fd, Opts0, IpFamily) -> _ -> Opts2 = [IpFamily | Opts], ?hlrt("listen", [{opts, Opts2}]), - ssl:listen(NewPort, Opts2) + ssl:listen(NewPort, Opts2 ++ ExtraOpts) end. |