aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src/ssl_tls_dist_proxy.erl
diff options
context:
space:
mode:
authorMagnus Henoch <[email protected]>2015-10-28 17:06:10 +0000
committerMagnus Henoch <[email protected]>2015-10-28 19:10:03 +0000
commitfcf198456fcd8e80c78b58c6616f7cf1266406cc (patch)
tree403cae04828cd84b48aacc8b258036c98d119059 /lib/ssl/src/ssl_tls_dist_proxy.erl
parentbd1251dfe4d60f09e569731d36a92e94acbe297a (diff)
downloadotp-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/src/ssl_tls_dist_proxy.erl')
-rw-r--r--lib/ssl/src/ssl_tls_dist_proxy.erl5
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;