Anyone got SSL over NSStreams to work?
Anyone got SSL over NSStreams to work?
- Subject: Anyone got SSL over NSStreams to work?
- From: Jay Koutavas <email@hidden>
- Date: Sat, 27 Aug 2005 11:38:14 -0400
In February of this year, I tried to use SSL over NSStream and ran into errors. I posted the following help request on the Cocoa list:
<x-tad-bigger>{ ...
[NSStream getStreamsToHost:host
port:port
inputStream:&mInStream
outputStream:&mOutStream];
[mInStream retain];
[mOutStream retain];
[mInStream setDelegate:self];
[mOutStream setDelegate:self];
[mInStream scheduleInRunLoop:[NSRunLoop currentRunLoop]
forMode:NSDefaultRunLoopMode];
[mOutStream scheduleInRunLoop:[NSRunLoop currentRunLoop]
forMode:NSDefaultRunLoopMode];
assert([mInStream setProperty:NSStreamSocketSecurityLevelNegotiatedSSL
forKey:NSStreamSocketSecurityLevelKey]);
assert([mOutStream
setProperty:NSStreamSocketSecurityLevelNegotiatedSSL
forKey:NSStreamSocketSecurityLevelKey]);
[mInStream open];
[mOutStream open];
}</x-tad-bigger>
<x-tad-bigger>In my stream:handleEvent: delegate method, I always get back an
NSStreamEventErrorOccurred event with an NSUnknownErrorDomain (-9813)
error. It doesn't matter which SSL property I set the socket to.
Always the same error. Turning off SSL on the output stream doesn't
change things either. On the server side, the machine's log is
indicating that an SSL connection is being made. I'm running this on
Mac OS X 10.3.7
Has anyone gotten this stuff to work? A search of the Net shows very
few mentions of using SSL with NSStreams, and there are unanswered
NSStreams+SSL questions in the cocoa-dev archive. I sure hope someone
could shed so light on what I may be missing.</x-tad-bigger>
(original message archive link is here: http://www.cocoabuilder.com/archive/message/cocoa/2005/1/14/125681)
Time has gone by, I'm on 10.3.9 and 10.4.2 now, and today I gave it another try. It is still failing.
Also here, someone is asking a similar question:
http://groups.google.com/group/comp.sys.mac.programmer.help/browse_thread/thread/6c3ad0dbe2ee39b0/9a1002ea0ebfc5bf?lnk=st&q=NSStreamSocketSecurityLevelNegotiatedSSL&rnum=1&hl=en#9a1002ea0ebfc5bf
And he did not get an answer.
What's missing in both our cases?
Thanks,
/Jay
_______________________________________________
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