Improve error message when local DoH is enabled without a certificate

Fixes #1136
This commit is contained in:
Frank Denis 2020-01-05 19:02:57 -05:00
parent 5c37d3b9de
commit 6fb42d0eae
1 changed files with 3 additions and 0 deletions

View File

@ -61,6 +61,9 @@ func (handler localDoHHandler) ServeHTTP(writer http.ResponseWriter, request *ht
func (proxy *Proxy) localDoHListener(acceptPc *net.TCPListener) {
defer acceptPc.Close()
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,