aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src/http_server
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2013-08-15 15:10:31 +0200
committerFredrik Gustafsson <[email protected]>2013-08-21 09:46:23 +0200
commit2ab0f356a00f42060d0f4ca9c4225644e2d9052e (patch)
treec9c0c87cd9347be852e34574da793dace350bbe3 /lib/inets/src/http_server
parent90f6229822c720d7616f9a11d1ca51e522586564 (diff)
downloadotp-2ab0f356a00f42060d0f4ca9c4225644e2d9052e.tar.gz
otp-2ab0f356a00f42060d0f4ca9c4225644e2d9052e.tar.bz2
otp-2ab0f356a00f42060d0f4ca9c4225644e2d9052e.zip
[inets, ssl]: make log_alert configurable as option in ssl, SSLLogLevel added as option to inets conf file
Diffstat (limited to 'lib/inets/src/http_server')
-rw-r--r--lib/inets/src/http_server/httpd_conf.erl18
-rw-r--r--lib/inets/src/http_server/httpd_request_handler.erl2
2 files changed, 18 insertions, 2 deletions
diff --git a/lib/inets/src/http_server/httpd_conf.erl b/lib/inets/src/http_server/httpd_conf.erl
index 884e3defb8..190967f656 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} ->
@@ -942,7 +949,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).
@@ -1208,6 +1216,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,