I am using SSL sockets to talk between an erlang program and a twisted python program. Different processes in my erlang app occasionally have to open connections and the first one opens fine, then the second errors with {error, closed}. <div>
<br></div><div>I don't know if I am misunderstanding something in SSL or Erlang. The simplest client code I could come up with is:</div><div><br></div><div><div>run_test()-></div><div>    ssl:start(),</div><div>    %%% works fine</div>
<div>    {ok, Conn} = ssl:connect("localhost", 2000, [binary, {packet, 0}, {keepalive, true}, {active, false}, { certfile, "controller.crt"}, {keyfile, "controller.key"} ]),</div><div>    %%% this next one will return {error, closed} </div>
<div>    {ok, Conn1} = ssl:connect("localhost", 2000, [binary, {packet, 0}, {keepalive, true}, {active, false}, { certfile, "controller.crt"}, {keyfile, "controller.key"} ]).</div><div><br></div>
</div><div><br></div><div>The python side gets the connection both times. Bizarrely, if I retry a connection after getting {error, closed} it works. </div><div><br></div><div>Any insight?</div><div><br></div><div>Dan</div>
<div><br></div><div><br></div>