Skip to content


SSL close function hang permanently #26

wants to merge 1 commit into from

3 participants


In case of TCP half close or something, ssl_connection process is hanging on function "workaround_transport_delivery_problems" in order to waiting packet from client.
It causes process leak to my server.

I added timeout to recv function. But I do not insure timeout of 5 seconds is sufficient.
(Maybe It would better move to SSL Options).

Please consider it. thank you.



This is not the correct channel to get your patch into Eralng/otp
Please send an email to the erlang-patches mailinglist instead. As we do not currently use pull-requests

Here the instructions on how to submit patches:

András Veres-Szentkirályi
(shamelessly copying Henrik's message to speed things up)



@proxyles proxyles closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 6, 2012
  1. timeout for SSL close hang

    Minsu Choi committed
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/ssl/src/ssl_connection.erl
3 lib/ssl/src/ssl_connection.erl
@@ -99,6 +99,7 @@
+-define(CLOSE_TIMEOUT, 5000).
-type state_name() :: hello | abbreviated | certify | cipher | connection.
-type gen_fsm_state_return() :: {next_state, state_name(), #state{}} |
@@ -2347,7 +2348,7 @@ workaround_transport_delivery_problems(Socket, Transport, _) ->
%% get a correct error message.
inet:setopts(Socket, [{active, false}]),
Transport:shutdown(Socket, write),
- Transport:recv(Socket, 0).
+ Transport:recv(Socket, 0, ?CLOSE_TIMEOUT).
linux_workaround_transport_delivery_problems(#alert{level = ?FATAL}, Socket) ->
case os:type() of
Something went wrong with that request. Please try again.