Re: CFNetwork: Notification for SSL/TLS handshake succeeded
Re: CFNetwork: Notification for SSL/TLS handshake succeeded
- Subject: Re: CFNetwork: Notification for SSL/TLS handshake succeeded
- From: "Quinn \"The Eskimo!\"" <email@hidden>
- Date: Wed, 14 Oct 2015 13:15:42 +0100
On 14 Oct 2015, at 08:44, Yulia Bensman <email@hidden> wrote:
> So, the question is: if there any way to receive a notification for NSStream, when SSL handshake succeeded(not only TCP connection established)?
I generally handle this by waiting for the first data event (.HasSpaceAvailable or .HasBytesAvailable). By the time you get that event the TLS handshake is fully up and you can interrogate its state as you wish (typically using the kCFStreamPropertySSLPeerTrust and kCFStreamPropertySSLContext properties). The TLSTool sample code shows this in practice.
<https://developer.apple.com/library/mac/samplecode/SC1236/>
Look in "TLSToolCommon.m" for the handling of the haveSentConnectionDidOpen property.
Share and Enjoy
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden