mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-20 20:26:42 +00:00
Add GSTLSServerName option
This commit is contained in:
parent
09da1e6894
commit
ed286536e2
8 changed files with 91 additions and 7 deletions
|
@ -882,6 +882,7 @@ static NSURLProtocol *placeholder = nil;
|
|||
GSTLSPriority,
|
||||
GSTLSRemoteHosts,
|
||||
GSTLSRevokeFile,
|
||||
GSTLSServerName,
|
||||
GSTLSVerify,
|
||||
nil];
|
||||
}
|
||||
|
@ -896,6 +897,20 @@ static NSURLProtocol *placeholder = nil;
|
|||
[this->output setProperty: str forKey: key];
|
||||
}
|
||||
}
|
||||
/* If there is no value set for the server name, and the host in the
|
||||
* URL is a domain name rather than an address, we use that.
|
||||
*/
|
||||
if (nil == [this->output propertyForKey: GSTLSServerName])
|
||||
{
|
||||
NSString *host = [url host];
|
||||
unichar c;
|
||||
|
||||
c = [host length] == 0 ? 0 : [host characterAtIndex: 0];
|
||||
if (c != 0 && c != ':' && !isdigit(c))
|
||||
{
|
||||
[this->output setProperty: host forKey: GSTLSServerName];
|
||||
}
|
||||
}
|
||||
if (_debug) [this->output setProperty: @"YES" forKey: GSTLSDebug];
|
||||
}
|
||||
[this->input setDelegate: self];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue