<div dir="ltr">I'm curious, its pretty unusual to not know which side of a TCP connection is the client or server, not just TLS, HTTP, SMTP, .... etc. Its almost always the side that makes the accept() call that's the server, but that doesn't have to be.<div><br></div><div>Why is it that you do not in this context?</div><div><br></div><div>Without it, you are fairly far off the beaten path. A normal TLS client would not be able to connect to your "accept()" side if it tried to be a client, and a normal TLS server would never initiate a connection to your "accept()" in the hopes that the acceptor would turn around and be a client.</div><div><br></div><div>The 1/0 isn't so terrible (well, maybe the protocol is terrible :-). To do a custom negotiation, then "step up" to TLS is done by other protocols. You could also sniff the TCP after accept, and wait a while to see if a client hello arrives to know if the other side is a client (or wait for any data, I don't thinkĀ a server starts sending data until it gets something, but its been a while since I looked).</div><div><br></div><div>Hope thats helpful, and even if not, it'd be interesting to know what apple is doing that is pushing you down this path.</div><div><br></div><div>Sam</div><div><br></div></div>