mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
backport GSCipherList configuration
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/stable@34280 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f8fca7a98a
commit
a0a46b1420
2 changed files with 16 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
|||
2011-12-14 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* SSL/GSSSLHandle.m: backport GSCipherList configuration.
|
||||
|
||||
2011-09-16 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Version: Bump to 1.22.2 for bugfix release
|
||||
|
|
|
@ -163,12 +163,15 @@ threadid_function()
|
|||
@end
|
||||
|
||||
static BOOL permitSSLv2 = NO;
|
||||
static NSString *cipherList = nil;
|
||||
|
||||
@implementation GSSSLHandle
|
||||
+ (void) _defaultsChanged: (NSNotification*)n
|
||||
{
|
||||
permitSSLv2
|
||||
= [[NSUserDefaults standardUserDefaults] boolForKey: @"GSPermitSSLv2"];
|
||||
cipherList
|
||||
= [[NSUserDefaults standardUserDefaults] stringForKey: @"GSCipherList"];
|
||||
}
|
||||
|
||||
+ (void) initialize
|
||||
|
@ -206,6 +209,7 @@ static BOOL permitSSLv2 = NO;
|
|||
}
|
||||
defs = [NSUserDefaults standardUserDefaults];
|
||||
permitSSLv2 = [defs boolForKey: @"GSPermitSSLv2"];
|
||||
cipherList = [defs stringForKey: @"GSCipherList"];
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
addObserver: self
|
||||
selector: @selector(_defaultsChanged:)
|
||||
|
@ -380,6 +384,10 @@ static BOOL permitSSLv2 = NO;
|
|||
{
|
||||
SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2);
|
||||
}
|
||||
if (nil != cipherList)
|
||||
{
|
||||
SSL_CTX_set_cipher_list(ctx, [cipherList UTF8String]);
|
||||
}
|
||||
}
|
||||
if (ssl == 0)
|
||||
{
|
||||
|
@ -443,6 +451,10 @@ static BOOL permitSSLv2 = NO;
|
|||
{
|
||||
SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2);
|
||||
}
|
||||
if (nil != cipherList)
|
||||
{
|
||||
SSL_CTX_set_cipher_list(ctx, [cipherList UTF8String]);
|
||||
}
|
||||
}
|
||||
if ([PEMpasswd length] > 0)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue