I\'m attempting to synchronously read from a CFReadStream objected created by CFStreamCreatePairWithSocketToHost. The stream opened fine but when I
I was able to eliminate this error by removing https:// from the host String.
NSStream.getStreamsToHostWithName("https://example.com" ...
You may need to set the appropriate security level:
inputStream!.setProperty(NSStreamSocketSecurityLevelTLSv1, forKey: NSStreamSocketSecurityLevelKey)
outputStream!.setProperty(NSStreamSocketSecurityLevelTLSv1, forKey: NSStreamSocketSecurityLevelKey)