Enable h2 ALPN with rustls-tls backend
This commit is contained in:
		| @@ -35,7 +35,7 @@ tokio-timer = "0.2.6" # a minimum version so trust-dns-resolver compiles | |||||||
| trust-dns-resolver = { version = "0.10", optional = true } | trust-dns-resolver = { version = "0.10", optional = true } | ||||||
| url = "1.2" | url = "1.2" | ||||||
| uuid = { version = "0.7", features = ["v4"] } | uuid = { version = "0.7", features = ["v4"] } | ||||||
| hyper-rustls = { version = "0.15", optional = true } | hyper-rustls = { version = "0.15.1", optional = true } | ||||||
| tokio-rustls = { version = "0.8", optional = true } | tokio-rustls = { version = "0.8", optional = true } | ||||||
| webpki-roots = { version = "0.15", optional = true } | webpki-roots = { version = "0.15", optional = true } | ||||||
| rustls = { version = "0.14", features = ["dangerous_configuration"], optional = true } | rustls = { version = "0.14", features = ["dangerous_configuration"], optional = true } | ||||||
|   | |||||||
| @@ -142,6 +142,10 @@ impl ClientBuilder { | |||||||
|                     use ::tls::NoVerifier; |                     use ::tls::NoVerifier; | ||||||
|  |  | ||||||
|                     let mut tls = ::rustls::ClientConfig::new(); |                     let mut tls = ::rustls::ClientConfig::new(); | ||||||
|  |                     tls.set_protocols(&[ | ||||||
|  |                         "h2".into(), | ||||||
|  |                         "http/1.1".into(), | ||||||
|  |                     ]); | ||||||
|                     tls.root_store.add_server_trust_anchors(&webpki_roots::TLS_SERVER_ROOTS); |                     tls.root_store.add_server_trust_anchors(&webpki_roots::TLS_SERVER_ROOTS); | ||||||
|  |  | ||||||
|                     if !config.certs_verification { |                     if !config.certs_verification { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user