Issue #1380: Reenable HTTP/2 for local DoH (#1384)

+Updated ci-test number 25 looking for invalid 404 to reflect changes here
This commit is contained in:
Krish De Souza 2020-06-28 17:20:20 +01:00 committed by GitHub
parent b089d49d25
commit 7b1ccd1053
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 4 deletions

View File

@ -82,7 +82,7 @@ t || dig -p${DNS_PORT} tracker.xdebian.org @127.0.0.1 | grep -Fq 'locally blocke
t || dig -p${DNS_PORT} tracker.debian.org @127.0.0.1 | grep -Fqv 'locally blocked' || fail
section
t || curl --insecure -siL https://127.0.0.1:${HTTP_PORT}/ | grep -Fq '404 Not Found' || fail
t || curl --insecure -siL https://127.0.0.1:${HTTP_PORT}/ | grep -Fq 'HTTP/2 404' || fail
t || curl --insecure -sL https://127.0.0.1:${HTTP_PORT}/dns-query | grep -Fq 'dnscrypt-proxy local DoH server' || fail
t ||
echo yv4BAAABAAAAAAABAAACAAEAACkQAAAAgAAAAA== | base64 -d |

View File

@ -1,7 +1,6 @@
package main
import (
"crypto/tls"
"io"
"io/ioutil"
"net"
@ -86,11 +85,9 @@ func (proxy *Proxy) localDoHListener(acceptPc *net.TCPListener) {
if len(proxy.localDoHCertFile) == 0 || len(proxy.localDoHCertKeyFile) == 0 {
dlog.Fatal("A certificate and a key are required to start a local DoH service")
}
noh2 := make(map[string]func(*http.Server, *tls.Conn, http.Handler))
httpServer := &http.Server{
ReadTimeout: proxy.timeout,
WriteTimeout: proxy.timeout,
TLSNextProto: noh2,
Handler: localDoHHandler{proxy: proxy},
}
httpServer.SetKeepAlivesEnabled(true)