diff options
Diffstat (limited to 'lib/inets/src/http_server/httpd_conf.erl')
-rw-r--r-- | lib/inets/src/http_server/httpd_conf.erl | 164 |
1 files changed, 3 insertions, 161 deletions
diff --git a/lib/inets/src/http_server/httpd_conf.erl b/lib/inets/src/http_server/httpd_conf.erl index 91f2020f77..ffa9a23fec 100644 --- a/lib/inets/src/http_server/httpd_conf.erl +++ b/lib/inets/src/http_server/httpd_conf.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2022. All Rights Reserved. +%% Copyright Ericsson AB 1997-2023. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -206,8 +206,7 @@ validate_config_params([{socket_type, ip_comm} | Rest]) -> validate_config_params(Rest); validate_config_params([{socket_type, {Value, Opts}} | Rest]) when Value == ip_comm; - Value == ssl; - Value == essl -> + Value == ssl -> %% Make sure not to set socket values used internally validate_config_params(Opts), validate_config_params(Rest); @@ -293,51 +292,6 @@ validate_config_params([{logger, Value} | Rest]) when is_list(Value) -> validate_config_params([{logger, Value} | _]) -> throw({logger, Value}); -validate_config_params([{ssl_certificate_file = Key, Value} | Rest]) -> - ok = httpd_util:file_validate(Key, Value), - validate_config_params(Rest); - -validate_config_params([{ssl_certificate_key_file = Key, Value} | Rest]) -> - ok = httpd_util:file_validate(Key, Value), - validate_config_params(Rest); - -validate_config_params([{ssl_verify_client, Value} | Rest]) - when (Value =:= 0) orelse (Value =:= 1) orelse (Value =:= 2) -> - validate_config_params(Rest); - -validate_config_params([{ssl_verify_client_depth, Value} | Rest]) - when is_integer(Value) andalso (Value >= 0) -> - validate_config_params(Rest); -validate_config_params([{ssl_verify_client_depth, Value} | _]) -> - throw({ssl_verify_client_depth, Value}); - -validate_config_params([{ssl_ciphers, Value} | Rest]) when is_list(Value) -> - validate_config_params(Rest); -validate_config_params([{ssl_ciphers, Value} | _]) -> - throw({ssl_ciphers, Value}); - -validate_config_params([{ssl_ca_certificate_file = Key, Value} | Rest]) -> - ok = httpd_util:file_validate(Key, Value), - validate_config_params(Rest); - -validate_config_params([{ssl_password_callback_module, Value} | Rest]) - when is_atom(Value) -> - validate_config_params(Rest); -validate_config_params([{ssl_password_callback_module, Value} | _]) -> - throw({ssl_password_callback_module, Value}); - -validate_config_params([{ssl_password_callback_function, Value} | Rest]) - when is_atom(Value) -> - validate_config_params(Rest); -validate_config_params([{ssl_password_callback_function, Value} | _]) -> - throw({ssl_password_callback_function, Value}); - -validate_config_params([{ssl_password_callback_arguments, Value} | Rest]) - when is_list(Value) -> - validate_config_params(Rest); -validate_config_params([{ssl_password_callback_arguments, Value} | _]) -> - throw({ssl_password_callback_arguments, Value}); - validate_config_params([{disable_chunked_transfer_encoding_send, Value} | Rest]) when (Value =:= true) orelse (Value =:= false) -> @@ -574,34 +528,9 @@ lookup_socket_type(ConfigDB) -> {ip_comm, _} = Type -> Type; {Tag, Conf} -> - {Tag, Conf}; - SSL when (SSL =:= ssl) orelse (SSL =:= essl) -> - SSLTag = - if - (SSL =:= ssl) -> - ?HTTP_DEFAULT_SSL_KIND; - true -> - SSL - end, - case ssl_certificate_file(ConfigDB) of - undefined -> - Reason = "Directive SSLCertificateFile " - "not found in the config file", - throw({error, Reason}); - SSLCertificateFile -> - {SSLTag, SSLCertificateFile ++ ssl_config(ConfigDB)} - end + {Tag, Conf} end. -ssl_config(ConfigDB) -> - ssl_certificate_key_file(ConfigDB) ++ - ssl_verify_client(ConfigDB) ++ - ssl_ciphers(ConfigDB) ++ - ssl_password(ConfigDB) ++ - ssl_verify_depth(ConfigDB) ++ - ssl_ca_certificate_file(ConfigDB) ++ - ssl_log_level(ConfigDB). - %%%======================================================================== %%% Internal functions %%%======================================================================== @@ -703,96 +632,9 @@ remove_traverse(ConfigDB,[Module|Rest]) -> remove_traverse(ConfigDB,Rest) end. -ssl_certificate_file(ConfigDB) -> - case httpd_util:lookup(ConfigDB,ssl_certificate_file) of - undefined -> - undefined; - SSLCertificateFile -> - [{certfile,SSLCertificateFile}] - end. - -ssl_certificate_key_file(ConfigDB) -> - case httpd_util:lookup(ConfigDB,ssl_certificate_key_file) of - undefined -> - []; - SSLCertificateKeyFile -> - [{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 -> - []; - SSLVerifyClient -> - [{verify,SSLVerifyClient}] - end. - -ssl_ciphers(ConfigDB) -> - case httpd_util:lookup(ConfigDB,ssl_ciphers) of - undefined -> - []; - Ciphers -> - [{ciphers, Ciphers}] - end. - -ssl_password(ConfigDB) -> - case httpd_util:lookup(ConfigDB,ssl_password_callback_module) of - undefined -> - []; - Module -> - case httpd_util:lookup(ConfigDB, - ssl_password_callback_function) of - undefined -> - []; - Function -> - Args = case httpd_util:lookup(ConfigDB, - ssl_password_callback_arguments) of - undefined -> - []; - Arguments -> - [Arguments] - end, - - case catch apply(Module, Function, Args) of - Password when is_list(Password) -> - [{password, Password}]; - Error -> - error_report(ssl_password,Module,Function,Error), - [] - end - end - end. - -ssl_verify_depth(ConfigDB) -> - case httpd_util:lookup(ConfigDB, ssl_verify_client_depth) of - undefined -> - []; - Depth -> - [{depth, Depth}] - end. - -ssl_ca_certificate_file(ConfigDB) -> - case httpd_util:lookup(ConfigDB, ssl_ca_certificate_file) of - undefined -> - []; - File -> - [{cacertfile, File}] - end. - plain_server_tokens() -> [none, prod, major, minor, minimum, os, full]. -error_report(Where,M,F,Error) -> - error_logger:error_report([{?MODULE, Where}, - {apply, {M, F, []}}, Error]). white_space_clean(String) -> re:replace(String, "^[ \t\n\r\f]*|[ \t\n\r\f]*\$","", [{return,list}, global]). |