mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Certificate usage support for https
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@19911 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
71a8c69719
commit
b480d424c4
4 changed files with 43 additions and 0 deletions
|
@ -12,6 +12,11 @@
|
|||
obtain handle for specific network link in use by a connection,
|
||||
and invalidate it when the connection is iunvaliodated.
|
||||
Fixes bug #9798
|
||||
* Headers/Foundation/NSURLHandle.h:
|
||||
* Source/GSHTTPURLHandle.m:
|
||||
* Source/NSURLHandle.m: Add new property keys for setting certificate
|
||||
information for https. Stopgap until we can clone newer MacOS-X
|
||||
features.
|
||||
|
||||
2004-08-23 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
|
|
|
@ -90,6 +90,25 @@ GS_EXPORT NSString * const GSHTTPPropertyProxyHostKey;
|
|||
* obtain proxy port.
|
||||
*/
|
||||
GS_EXPORT NSString * const GSHTTPPropertyProxyPortKey;
|
||||
|
||||
/**
|
||||
* Key for passing to [NSURLHandle]'s <code>propertyForKey..</code> methods to
|
||||
* specify the location of an SSL certificate file.
|
||||
*/
|
||||
GS_EXPORT NSString * const GSHTTPSCertificateFileKey;
|
||||
|
||||
/**
|
||||
* Key for passing to [NSURLHandle]'s <code>propertyForKey..</code> methods to
|
||||
* specify the location of an SSL key file.
|
||||
*/
|
||||
GS_EXPORT NSString * const GSHTTPSKeyFileKey;
|
||||
|
||||
/**
|
||||
* Key for passing to [NSURLHandle]'s <code>propertyForKey..</code> methods to
|
||||
* specify the password for an SSL key file.
|
||||
*/
|
||||
GS_EXPORT NSString * const GSHTTPSKeyPasswordKey;
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
|
@ -514,6 +514,8 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data)
|
|||
}
|
||||
if ([[url scheme] isEqualToString: @"https"])
|
||||
{
|
||||
NSString *cert;
|
||||
|
||||
if (sslClass == 0)
|
||||
{
|
||||
[self backgroundLoadDidFailWithReason:
|
||||
|
@ -523,6 +525,14 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data)
|
|||
sock = [sslClass fileHandleAsClientInBackgroundAtAddress: host
|
||||
service: port
|
||||
protocol: s];
|
||||
cert = [request objectForKey: GSHTTPSCertificateFileKey];
|
||||
if ([cert length] > 0)
|
||||
{
|
||||
NSString *key = [request objectForKey: GSHTTPSKeyFileKey];
|
||||
NSString *pwd = [request objectForKey: GSHTTPSKeyPasswordKey];
|
||||
|
||||
[sock sslSetCertificate: cert privateKey: key PEMpasswd: pwd];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -73,6 +73,15 @@ NSString * const GSHTTPPropertyProxyHostKey
|
|||
NSString * const GSHTTPPropertyProxyPortKey
|
||||
= @"GSHTTPPropertyProxyPortKey";
|
||||
|
||||
NSString * const GSHTTPSCertificateFileKey
|
||||
= @"GSHTTPSCertificateFileKey";
|
||||
|
||||
NSString * const GSHTTPSKeyFileKey
|
||||
= @"GSHTTPSKeyFileKey";
|
||||
|
||||
NSString * const GSHTTPSKeyPasswordKey
|
||||
= @"GSHTTPSKeyPasswordKey";
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
|
Loading…
Reference in a new issue