NSURLProtectionSpace: improve authentication method handling

Improve handling of NSURL authentication methods. Make "HTMLForm"
authentication a no-op as it should be instead of making it fall back to
Basic authentication.

Add stubs for NTLM and Negotiate IIS methods. They should be easily
implementable given the current framework for authentication methods.

Add stubs for ClientCertificate and ServerTrust authentication methods.
A blocker for supporting them is the lack of a Security.framework
implementation (since they rely on SecTrustRef). They would also require
additions to the current SSL handling code for GNUstep https requests.
Also stub the -distinguishedNames property of NSURLProtectionSpace,
which also deals with certificate-related authentication methods.
This commit is contained in:
Daniel Ferreira 2017-06-21 10:01:56 +10:00 committed by Ivan Vučica
parent aa70ff5300
commit 814c19ecce
3 changed files with 91 additions and 3 deletions

View file

@ -41,7 +41,7 @@ extern NSString * const NSURLProtectionSpaceHTTPProxy; /** An HTTP proxy */
extern NSString * const NSURLProtectionSpaceHTTPSProxy; /** An HTTPS proxy */
extern NSString * const NSURLProtectionSpaceSOCKSProxy; /** A SOCKS proxy */
/** Default authentication */
/** Default authentication (Basic) */
extern NSString * const NSURLAuthenticationMethodDefault;
/** HTML form authentication */
@ -53,6 +53,15 @@ extern NSString * const NSURLAuthenticationMethodHTTPBasic;
/** HTTP Digest authentication */
extern NSString * const NSURLAuthenticationMethodHTTPDigest;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5,GS_API_LATEST) && GS_API_VERSION( 11300,GS_API_LATEST)
extern NSString * const NSURLAuthenticationMethodNTLM;
extern NSString * const NSURLAuthenticationMethodNegotiate;
#endif
#if OS_API_VERSION(MAC_OS_X_VERSION_10_6,GS_API_LATEST) && GS_API_VERSION( 11300,GS_API_LATEST)
extern NSString * const NSURLAuthenticationMethodClientCertificate;
extern NSString * const NSURLAuthenticationMethodServerTrust;
#endif
/**
* Class to encapsulate a protection space ... where authentication is
@ -129,6 +138,14 @@ authenticationMethod: (NSString *)authenticationMethod;
*/
- (BOOL) receivesCredentialSecurely;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_6,GS_API_LATEST) && GS_API_VERSION( 11300,GS_API_LATEST)
#if GS_HAS_DECLARED_PROPERTIES
@property (readonly, copy) NSArray *distinguishedNames;
#else
- (NSArray *) distinguishedNames;
#endif
#endif
@end
#if defined(__cplusplus)