Question

I am attempting to look at the SSLContext in a CFReadStream. secureTransport has lots of useful methods for examining a SSLContextRef like SSLGetEnabledCiphers, but I don't have a good way to get a SSLContextRef from CFReadStream. Is there some sort of getter method for SSLContextRef in CFNetworks?

Was it helpful?

Solution

If anyone else has this problem, take note, you can't. What you can do is create a new SSL context, send the readstream to the context and encrypt the stream there. What you can't is get the cipher settings from CFNetwork classes. I suppose Apple wants them to remain private.

OTHER TIPS

You should be able to retrieve the SSLContextRef using CFReadStreamCopyProperty. For example, see this code from the Apple TLSTool sample:

context = (SSLContextRef) CFReadStreamCopyProperty((__bridge CFReadStreamRef) inputStream, kCFStreamPropertySSLContext);

The kCFStreamPropertySSLContext is available as of OS X 10.9 and iOS 5.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top