#include "rand.h"
#include "multiif.h"
#include "cfilters.h"
+#include "cf-dns.h"
#include "cf-socket.h"
#include "connect.h"
#include "progress.h"
return result;
}
+static bool cf_ngtcp2_need_httpsrr(struct Curl_easy *data)
+{
+#ifdef USE_OPENSSL
+ return Curl_ossl_need_httpsrr(data);
+#elif defined(USE_WOLFSSL)
+ return Curl_wssl_need_httpsrr(data);
+#else
+ (void)data;
+ return FALSE;
+#endif
+}
+
/*
* Might be called twice for happy eyeballs.
*/
}
*done = FALSE;
- pktx_init(&pktx, cf, data);
+ if(cf_ngtcp2_need_httpsrr(data) &&
+ !Curl_conn_dns_resolved_https(data, cf->sockindex)) {
+ CURL_TRC_CF(data, cf, "need HTTPS-RR, delaying connect");
+ return CURLE_OK;
+ }
+
+ pktx_init(&pktx, cf, data);
CF_DATA_SAVE(save, cf, data);
if(!ctx->qconn) {
#include "uint-hash.h"
#include "urldata.h"
#include "cfilters.h"
+#include "cf-dns.h"
#include "cf-socket.h"
#include "curl_trc.h"
#include "rand.h"
}
*done = FALSE;
+ if(Curl_ossl_need_httpsrr(data) &&
+ !Curl_conn_dns_resolved_https(data, cf->sockindex)) {
+ CURL_TRC_CF(data, cf, "need HTTPS-RR, delaying connect");
+ return CURLE_OK;
+ }
+
vquic_ctx_update_time(&ctx->q, Curl_pgrs_now(data));
if(!ctx->qconn) {
}
#ifdef HAVE_SSL_SET1_ECH_CONFIG_LIST
-static bool ossl_ech_need_httpsrr(struct Curl_easy *data)
+bool Curl_ossl_need_httpsrr(struct Curl_easy *data)
{
if(!CURLECH_ENABLED(data))
return FALSE;
const unsigned char *ecl = rinfo->echconfiglist;
size_t elen = rinfo->echconfiglist_len;
- infof(data, "ECH: ECHConfig from DoH HTTPS RR");
+ infof(data, "ECH: ECHConfig from HTTPS RR");
if(SSL_set1_ech_config_list(octx->ssl, ecl, elen) != 1) {
infof(data, "ECH: SSL_set1_ech_config_list failed");
if(data->set.tls_ech & CURLECH_HARD)
return CURLE_OK;
}
-#endif /* HAVE_SSL_SET1_ECH_CONFIG_LIST */
+#else /* HAVE_SSL_SET1_ECH_CONFIG_LIST */
+bool Curl_ossl_need_httpsrr(struct Curl_easy *data)
+{
+ (void)data;
+ return FALSE;
+}
+#endif /* else HAVE_SSL_SET1_ECH_CONFIG_LIST */
static CURLcode ossl_init_ssl(struct ossl_ctx *octx,
struct Curl_cfilter *cf,
connssl->io_need = CURL_SSL_IO_NEED_NONE;
if(ssl_connect_1 == connssl->connecting_state) {
-#ifdef HAVE_SSL_SET1_ECH_CONFIG_LIST
- /* if we do ECH and need the HTTPS-RR information for it,
- * we delay the connect until it arrives or DNS resolve fails. */
- if(ossl_ech_need_httpsrr(data) &&
+ if(Curl_ossl_need_httpsrr(data) &&
!Curl_conn_dns_resolved_https(data, cf->sockindex)) {
- CURL_TRC_CF(data, cf, "need HTTPS-RR for ECH, delaying connect");
+ CURL_TRC_CF(data, cf, "need HTTPS-RR, delaying connect");
return CURLE_OK;
}
-#endif
CURL_TRC_CF(data, cf, "ossl_connect, step1");
result = ossl_connect_step1(cf, data);
if(result)
void *ssl_user_data,
Curl_ossl_init_session_reuse_cb *sess_reuse_cb);
+/* Is a resolved HTTPS-RR needed for initializing OpenSSL? */
+bool Curl_ossl_need_httpsrr(struct Curl_easy *data);
+
#ifndef HAVE_OPENSSL3
#define SSL_get1_peer_certificate SSL_get_peer_certificate
#endif
const unsigned char *ecl = rinfo->echconfiglist;
size_t elen = rinfo->echconfiglist_len;
- infof(data, "ECH: ECHConfig from DoH HTTPS RR");
+ infof(data, "ECH: ECHConfig from HTTPS RR");
if(wolfSSL_SetEchConfigs(wctx->ssl, ecl, (word32)elen) !=
WOLFSSL_SUCCESS) {
infof(data, "ECH: wolfSSL_SetEchConfigs failed");
return result;
}
-#ifdef HAVE_WOLFSSL_CTX_GENERATEECHCONFIG
-static bool wssl_ech_need_httpsrr(struct Curl_easy *data)
+bool Curl_wssl_need_httpsrr(struct Curl_easy *data)
{
+#ifdef HAVE_WOLFSSL_CTX_GENERATEECHCONFIG
if(!CURLECH_ENABLED(data))
return FALSE;
if((data->set.tls_ech & CURLECH_GREASE) ||
(data->set.tls_ech & CURLECH_CLA_CFG))
return FALSE;
return TRUE;
-}
+#else
+ (void)data;
+ return FALSE;
#endif
+}
/*
* This function loads all the client/CA certificates and CRLs. Setup the TLS
#ifdef HAVE_WOLFSSL_CTX_GENERATEECHCONFIG
/* if we do ECH and need the HTTPS-RR information for it,
* we delay the connect until it arrives or DNS resolve fails. */
- if(wssl_ech_need_httpsrr(data) &&
+ if(Curl_wssl_need_httpsrr(data) &&
!Curl_conn_dns_resolved_https(data, cf->sockindex)) {
CURL_TRC_CF(data, cf, "need HTTPS-RR for ECH, delaying connect");
return CURLE_OK;
void *ssl_user_data,
Curl_wssl_init_session_reuse_cb *sess_reuse_cb);
+/* Is a resolved HTTPS-RR needed for initializing wolfSSL? */
+bool Curl_wssl_need_httpsrr(struct Curl_easy *data);
+
CURLcode Curl_wssl_setup_x509_store(struct Curl_cfilter *cf,
struct Curl_easy *data,
struct wssl_ctx *wssl);