dnsOverride

Sometimes it can be useful to connect to one host e.g. x.example.com but request and validate the certificate chain as if we would connect to y.example.com. dnsOverride allows to do just that by mapping host names which we will request and validate the certificate chain, to a different host name which will be used to actually connect to.

HTTPClient.swift:791
var dnsOverride: [String : String]

Example: if dnsOverride is set to ["example.com": "localhost"] and we execute a request with a url of https://example.com/, the HTTPClient will actually open a connection to localhost instead of example.com. HTTPClient will still request certificates from the server for example.com and validate them as if we would connect to example.com.