I have an SSL server, and I want to downgrade this after receiving the first ssl:recv to a raw gen_tcp. Assuming this can be used to do that I can not find an example on how to use this. And I am not so good at using the Erlang/OTP documentation yet http://erlang.org/doc/man/ssl.html#close-2
I am a bit confused with NewController::pid() from the documentation:
How = timeout() | {NewController::pid(), timeout()}
NewController::pid()here refers to the process you want to set as the "controlling process" for the downgraded TCP socket.gen_tcpfunctions on the socket will only work if called from that process. You'll want to sendself()here unless you want to use the downgraded TCP socket from another process.The only example I could find of
ssl:close/2being used with a tuple as the second argument is this test. Here's a simplified version of that code to get you started: