Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Anyone got SSL over NSStreams to work?



-9813 looks like a security error; looking at SecureTransport.h, -9813 is errSSLNoRootCert.  Are you sure the certificate on the server you're trying to contact is good?  To test, you might set your streams to somewhere with a known good certificate, like the https port (443) of a banking or e-commerce site (first make sure your browser can get there, to make sure the port's really open).

Good luck,
REW


On Aug 27, 2005, at 10:05 AM, Jay Koutavas wrote:

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:

{ ...
    [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];
}

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.


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:


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

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/macnetworkprog/email@hidden

This email sent to email@hidden

References: 
 >Anyone got SSL over NSStreams to work? (From: Jay Koutavas <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.