<div dir="ltr">Hi!<br><div><div class="gmail_extra"><br><div class="gmail_quote">2013/4/17 pablo platt <span dir="ltr"><<a href="mailto:pablo.platt@gmail.com" target="_blank">pablo.platt@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr"><div><div><div>Hi,<br><br></div>Is it possible to accept SSL connections and normal TCP connections on the same port?<br></div>Maybe accept normal TCP connections. If the connection is SSL connection pass it to the ssl module  and if it is a normal TCP connection just handle the socket.<br>
</div></div></blockquote><div><br></div><div>It is possible to upgrade a tcp socket to an ssl socket.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr"><div></div><div>If it is possible, how can I distinct SSL from non SSL connections?<br></div></div></blockquote><div><br></div><div>That is the hard part. You must have some scheme to negotiate the upgrade with the client over plain tcp. (Like STARTTLS, HTTP Connect etc)<br>
 </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><div>How can I pass the socket to the ssl module?<br></div></div></blockquote>
<br><div>ssl:ssl_accept(TcpSocket, SslOptions)  or ssl:connect(TcpSocket, SslOptions) <br></div><div>make sure the socket is passive ({active, false}) before you make the call.<br></div><div><br></div>Regards Ingela Erlang/OTP team Ericsson AB<br>
</div></div></div></div>