We used to only have hostnames available. now we have pubkey_pinsets
available as well.
We want upstream->tls_auth_failed to be 1 when any authentication
mechanism we've been asked for fails (and also when we haven't been
given any authentication mechanism at all).
if the upstream is configured to allow fallback, this will not be a
fatal error, but it will still be checked.
Future work:
* verify any certs higher in the chain than the end-entity cert
* deal with raw public keys
* in the fallback case, report to the user whether the pinset match failed
We do this by associating a getdns_upstream object with the SSL object
handled by that upstream.
This allows us to collapse the verification callback code to a single
function.
Note that if we've agreed that fallback is ok, we are now willing to
accept *any* cert verification error, not just HOSTNAME_MISMATCH.
This is fine, because the alternative is falling back to cleartext,
which would be worse.
We also always set SSL_VERIFY_PEER, since we might as well try to do
so; we'll drop the verification error ourselves if we know we're OK
with falling back.
https://tools.ietf.org/html/draft-ietf-dnsop-edns-client-subnet-04
Using the above spec, an intermediate resolver may forward a chunk of
the client's IP address to the authoritative resolver.
Setting edns_client_subnet_private to a getdns_context in stub mode
will indicate to the next-hop recursive resolver that the client
wishes to keep their address information private.
Sending DNS cookies was overwriting any existing options (DNS OPT) in
the outbound query.
Also, DNS cookies may not be the only option that gets set
per-upstream (instead of per-query).
This changeset establishes a set of per-query options (established at
the time of the query), and a buffer of additional space for adding
options based on the upstream is in use.
The size of this buffer is defined at configure time (defaults to 3000
octets).
Just before a query is sent out, we add the per-upstream options to
the query.
Note: we're also standardizing the query in tls too, even though we're
not sending any upstream options in that case at the moment
(edns_cookies are much weaker than TLS itself)
There is no clear reason to reject servers that don't have RSA certs.
We should accept ECDSA certs as well.
(also, clean up comments about opportunistic TLS)