diff options
Diffstat (limited to 'lib/inets')
-rw-r--r-- | lib/inets/doc/src/notes.xml | 15 | ||||
-rw-r--r-- | lib/inets/src/http_lib/http_transport.erl | 21 | ||||
-rw-r--r-- | lib/inets/src/http_server/httpd_conf.erl | 18 | ||||
-rw-r--r-- | lib/inets/src/http_server/httpd_request_handler.erl | 2 |
4 files changed, 44 insertions, 12 deletions
diff --git a/lib/inets/doc/src/notes.xml b/lib/inets/doc/src/notes.xml index ed07f80d37..42183b8cc5 100644 --- a/lib/inets/doc/src/notes.xml +++ b/lib/inets/doc/src/notes.xml @@ -45,8 +45,6 @@ </item> </list> </section> - - <section><title>Improvements and New Features</title> <list> <item> @@ -158,7 +156,20 @@ </section> </section> +<section><title>Inets 5.9.2.2</title> + <section><title>Improvements and New Features</title> + <list> + <item> + <p> + Make log_alert configurable as option in ssl, SSLLogLevel + added as option to inets conf file</p> + <p> + Own Id: OTP-11259</p> + </item> + </list> + </section> +</section> <section><title>Inets 5.9.2.1</title> <section><title>Improvements and New Features</title> <list> 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. diff --git a/lib/inets/src/http_server/httpd_conf.erl b/lib/inets/src/http_server/httpd_conf.erl index d45f3c0048..b3ca13e2fe 100644 --- a/lib/inets/src/http_server/httpd_conf.erl +++ b/lib/inets/src/http_server/httpd_conf.erl @@ -390,6 +390,13 @@ load("SSLCertificateFile " ++ SSLCertificateFile, []) -> {error, ?NICE(clean(SSLCertificateFile)++ " is an invalid SSLCertificateFile")} end; +load("SSLLogLevel " ++ SSLLogAlert, []) -> + case SSLLogAlert of + "none" -> + {ok, [], {ssl_log_alert, false}}; + _ -> + {ok, [], {ssl_log_alert, true}} + end; load("SSLCertificateKeyFile " ++ SSLCertificateKeyFile, []) -> case is_file(clean(SSLCertificateKeyFile)) of {ok, File} -> @@ -948,7 +955,8 @@ ssl_config(ConfigDB) -> ssl_ciphers(ConfigDB) ++ ssl_password(ConfigDB) ++ ssl_verify_depth(ConfigDB) ++ - ssl_ca_certificate_file(ConfigDB). + ssl_ca_certificate_file(ConfigDB) ++ + ssl_log_level(ConfigDB). @@ -1214,6 +1222,14 @@ ssl_certificate_key_file(ConfigDB) -> [{keyfile,SSLCertificateKeyFile}] end. +ssl_log_level(ConfigDB) -> + case httpd_util:lookup(ConfigDB,ssl_log_alert) of + undefined -> + []; + SSLLogLevel -> + [{log_alert,SSLLogLevel}] + end. + ssl_verify_client(ConfigDB) -> case httpd_util:lookup(ConfigDB,ssl_verify_client) of undefined -> diff --git a/lib/inets/src/http_server/httpd_request_handler.erl b/lib/inets/src/http_server/httpd_request_handler.erl index 0f47d785ef..cb20159794 100644 --- a/lib/inets/src/http_server/httpd_request_handler.erl +++ b/lib/inets/src/http_server/httpd_request_handler.erl @@ -106,7 +106,7 @@ init([Manager, ConfigDB, AcceptTimeout]) -> case http_transport:negotiate(SocketType, Socket, TimeOut) of {error, Error} -> ?hdrd("negotiation failed", [{error, Error}]), - exit(Error); %% Can be 'normal'. + exit(shutdown); %% Can be 'normal'. ok -> ?hdrt("negotiation successfull", []), NewTimeout = TimeOut - timer:now_diff(now(),Then) div 1000, |