Certificates that can't be loaded are fatal

This commit is contained in:
Frank Denis 2020-03-24 14:31:43 +01:00
parent 2670caa71e
commit 315f6f45ff
2 changed files with 2 additions and 2 deletions

View File

@ -407,7 +407,7 @@ func fetchDoHServerInfo(proxy *Proxy, name string, stamp stamps.ServerStamp, isN
dohClientCreds, ok = (*proxy.dohCreds)["*"]
}
if ok {
dlog.Noticef("[%s] Cert: %s, Key: %s", name, dohClientCreds.clientCert, dohClientCreds.clientKey)
dlog.Noticef("Enabling TLS authentication for [%s]", name)
proxy.xTransport.tlsClientCreds = dohClientCreds
proxy.xTransport.rebuildTransport()
}

View File

@ -162,7 +162,7 @@ func (xTransport *XTransport) rebuildTransport() {
if (clientCreds != DOHClientCreds{}) {
cert, err := tls.LoadX509KeyPair(clientCreds.clientCert, clientCreds.clientKey)
if err != nil {
dlog.Error(err)
dlog.Fatalf("Unable to use certificate [%v] (key: [%v]): %v", clientCreds.clientCert, clientCreds.clientKey, err)
}
tlsClientConfig.Certificates = []tls.Certificate{cert}
}