From ffb78948a5ae0baee9ffbe8a6fcea50ca5dc8ffb Mon Sep 17 00:00:00 2001 From: rfm Date: Sun, 6 Jan 2008 07:54:08 +0000 Subject: [PATCH] Add https support git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@25879 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 9 +++++---- Source/NSURLProtocol.m | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 19dc2517d..fe35fe633 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-01-05 Richard Frith-Macdonald + + * Source/GSSocketStream.m: Try to honor protocol requested. + * Source/NSURLProtocol.m: Add https + 2008-01-05 Nicola Pero * Source/Additions/GSXML.m ([GSXPathContext @@ -5,10 +10,6 @@ namespaces in XPath expressions. * Headers/Additions/GNUstepBase/GSXML.h: Same. -2008-01-05 Richard Frith-Macdonald - - * Source/GSSocketStream.m: Try to honor protocol requested. - 2008-01-05 Richard Frith-Macdonald * config/pathtls.m4: fixup form mingw32 diff --git a/Source/NSURLProtocol.m b/Source/NSURLProtocol.m index b2188a1cf..64e5724d6 100644 --- a/Source/NSURLProtocol.m +++ b/Source/NSURLProtocol.m @@ -447,6 +447,13 @@ static NSURLProtocol *placeholder = nil; RETAIN(this->input); RETAIN(this->output); [self _didInitializeOutputStream: this->output]; + if ([[url scheme] isEqualToString: @"https"] == YES) + { + [this->input setProperty: NSStreamSocketSecurityLevelNegotiatedSSL + forKey: NSStreamSocketSecurityLevelKey]; + [this->output setProperty: NSStreamSocketSecurityLevelNegotiatedSSL + forKey: NSStreamSocketSecurityLevelKey]; + } [this->input setDelegate: self]; [this->output setDelegate: self]; [self _schedule]; @@ -1124,6 +1131,13 @@ static NSURLProtocol *placeholder = nil; } RETAIN(this->input); RETAIN(this->output); + if ([[url scheme] isEqualToString: @"https"] == YES) + { + [this->input setProperty: NSStreamSocketSecurityLevelNegotiatedSSL + forKey: NSStreamSocketSecurityLevelKey]; + [this->output setProperty: NSStreamSocketSecurityLevelNegotiatedSSL + forKey: NSStreamSocketSecurityLevelKey]; + } [this->input setDelegate: self]; [this->output setDelegate: self]; [this->input scheduleInRunLoop: [NSRunLoop currentRunLoop]