mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
attempt to handle tls handshake failure properly
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37274 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
cd76262056
commit
f769807665
3 changed files with 59 additions and 13 deletions
|
@ -504,7 +504,30 @@ static NSArray *keys = nil;
|
|||
if ([session handshake] == YES)
|
||||
{
|
||||
handshake = NO; // Handshake is now complete.
|
||||
active = [session active]; // The TLS session is now active.
|
||||
active = [session active]; // Is the TLS session now active?
|
||||
if (NO == active)
|
||||
{
|
||||
NSString *problem = [session problem];
|
||||
NSError *theError;
|
||||
|
||||
if (nil == problem)
|
||||
{
|
||||
problem = @"TLS handshake failure";
|
||||
}
|
||||
theError = [NSError errorWithDomain: NSCocoaErrorDomain
|
||||
code: 0
|
||||
userInfo: [NSDictionary dictionaryWithObject: problem
|
||||
forKey: NSLocalizedDescriptionKey]];
|
||||
if ([istream streamStatus] != NSStreamStatusError)
|
||||
{
|
||||
[istream _recordError: theError];
|
||||
}
|
||||
if ([ostream streamStatus] != NSStreamStatusError)
|
||||
{
|
||||
[ostream _recordError: theError];
|
||||
}
|
||||
[self bye];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue