diff options
author | Magnus Henoch <[email protected]> | 2015-10-28 17:06:10 +0000 |
---|---|---|
committer | Magnus Henoch <[email protected]> | 2015-10-28 19:10:03 +0000 |
commit | fcf198456fcd8e80c78b58c6616f7cf1266406cc (patch) | |
tree | 403cae04828cd84b48aacc8b258036c98d119059 /lib/ssl | |
parent | bd1251dfe4d60f09e569731d36a92e94acbe297a (diff) | |
download | otp-fcf198456fcd8e80c78b58c6616f7cf1266406cc.tar.gz otp-fcf198456fcd8e80c78b58c6616f7cf1266406cc.tar.bz2 otp-fcf198456fcd8e80c78b58c6616f7cf1266406cc.zip |
Report bad options for TLS distribution connections
If ssl:ssl_accept/2 returns an error related to options, it's most
likely something we want to log. In particular, if the specified
certificate file doesn't exist, this is where the error ends up, so we
shouldn't just throw the error away.
Diffstat (limited to 'lib/ssl')
-rw-r--r-- | lib/ssl/src/ssl_tls_dist_proxy.erl | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/ssl/src/ssl_tls_dist_proxy.erl b/lib/ssl/src/ssl_tls_dist_proxy.erl index a22af6b960..e7f7fa96a1 100644 --- a/lib/ssl/src/ssl_tls_dist_proxy.erl +++ b/lib/ssl/src/ssl_tls_dist_proxy.erl @@ -157,6 +157,11 @@ accept_loop(Proxy, world = Type, Listen, Extra) -> end), ok = ssl:controlling_process(SslSocket, PairHandler), flush_old_controller(PairHandler, SslSocket); + {error, {options, _}} = Error -> + %% Bad options: that's probably our fault. Let's log that. + error_logger:error_msg("Cannot accept TLS distribution connection: ~s~n", + [ssl:format_error(Error)]), + gen_tcp:close(Socket); _ -> gen_tcp:close(Socket) end; |