Dire perche' una richiesta fallisce, e annunciare HTTP/1.1 con ALPN

engine_session_fetch non riportava il motivo: restituiva NULL e il guscio
mostrava "richiesta fallita", che non serve a nessuno. Ora c'e' un parametro
d'errore e il guscio lo scrive nel log insieme all'indirizzo.

TLS annuncia http/1.1 con ALPN: alcuni server e CDN rifiutano chi non negozia
nulla, ed era una differenza silenziosa rispetto ai browser veri.
This commit is contained in:
Carlo Baratto committed 2026-11-12 20:51:48 +01:00
1 parent 4d0e55bc16
commit befb3f289f
6 files changed
+54 -11

No files matched your search

+3 -1
View File
@@ -410,13 +410,15 @@ fn apri_tls(
let radici = rustls::RootCertStore {
roots: webpki_roots::TLS_SERVER_ROOTS.to_vec(),
};
let configurazione = rustls::ClientConfig::builder_with_provider(std::sync::Arc::new(
let mut configurazione = rustls::ClientConfig::builder_with_provider(std::sync::Arc::new(
rustls::crypto::ring::default_provider(),
))
.with_safe_default_protocol_versions()
.map_err(|e| format!("versioni TLS: {}", e))?
.with_root_certificates(radici)
.with_no_client_auth();
// annunciare HTTP/1.1: alcuni server (e CDN) rifiutano chi non negozia nulla
configurazione.alpn_protocols = vec![b"http/1.1".to_vec()];
let nome = rustls::pki_types::ServerName::try_from(host.to_string())
.map_err(|_| format!("nome del server non valido: {}", host))?;