Merge pull request #519 from getdnsapi/use_dot_alpn

Update Stubby to always send the `dot` ALPN when using DoT
This commit is contained in:
Willem Toorop 2022-08-09 16:54:30 +02:00 committed by GitHub
commit 893d4720c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -1,4 +1,5 @@
* 2022-07-20
* 2022-08-12: Version 1.7.1
* Always send the `dot` ALPN when using DoT
* Strengthen version determination for Libidn2 during cmake processing (thanks
jpbion).

View File

@ -320,6 +320,10 @@ void _getdns_tls_init()
#endif
}
#define DOT_PROTO_ALPN_ID "dot"
#define DOT_PROTO_ALPN "\x3" DOT_PROTO_ALPN_ID
#define DOT_PROTO_ALPN_LEN (sizeof(DOT_PROTO_ALPN) - 1)
_getdns_tls_context* _getdns_tls_context_new(struct mem_funcs* mfs, const getdns_log_config* log)
{
_getdns_tls_context* res;
@ -348,6 +352,8 @@ _getdns_tls_context* _getdns_tls_context_new(struct mem_funcs* mfs, const getdns
GETDNS_FREE(*mfs, res);
return NULL;
}
SSL_CTX_set_alpn_protos(res->ssl, (const uint8_t *)DOT_PROTO_ALPN,
DOT_PROTO_ALPN_LEN);
return res;
}