mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
More SSL/TLS options support
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35618 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
98b5b4c973
commit
388bb2be49
6 changed files with 137 additions and 30 deletions
|
@ -33,6 +33,7 @@
|
|||
#import "Foundation/NSValue.h"
|
||||
|
||||
#import "GSPrivate.h"
|
||||
#import "GSTLS.h"
|
||||
#import "GSURLPrivate.h"
|
||||
#import "GNUstepBase/GSMime.h"
|
||||
#import "GNUstepBase/NSObject+GNUstepBase.h"
|
||||
|
@ -780,10 +781,39 @@ static NSURLProtocol *placeholder = nil;
|
|||
#endif
|
||||
if ([[url scheme] isEqualToString: @"https"] == YES)
|
||||
{
|
||||
static NSArray *keys;
|
||||
NSUInteger count;
|
||||
|
||||
[this->input setProperty: NSStreamSocketSecurityLevelNegotiatedSSL
|
||||
forKey: NSStreamSocketSecurityLevelKey];
|
||||
[this->output setProperty: NSStreamSocketSecurityLevelNegotiatedSSL
|
||||
forKey: NSStreamSocketSecurityLevelKey];
|
||||
if (nil == keys)
|
||||
{
|
||||
keys = [[NSArray alloc] initWithObjects:
|
||||
GSTLSCAFile,
|
||||
GSTLSCertificateFile,
|
||||
GSTLSCertificateKeyFile,
|
||||
GSTLSCertificateKeyPassword,
|
||||
GSTLSDebug,
|
||||
GSTLSPriority,
|
||||
GSTLSRemoteHosts,
|
||||
GSTLSRevokeFile,
|
||||
GSTLSVerify,
|
||||
nil];
|
||||
}
|
||||
count = [keys count];
|
||||
while (count-- > 0)
|
||||
{
|
||||
NSString *key = [keys objectAtIndex: count];
|
||||
NSString *str = [this->request _propertyForKey: key];
|
||||
|
||||
if (nil != str)
|
||||
{
|
||||
[this->output setProperty: str forKey: key];
|
||||
}
|
||||
}
|
||||
if (_debug) [this->output setProperty: @"YES" forKey: GSTLSDebug];
|
||||
}
|
||||
[this->input setDelegate: self];
|
||||
[this->output setDelegate: self];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue