Skip to content

Commit

Permalink
Certificates that can't be loaded are fatal
Browse files Browse the repository at this point in the history
  • Loading branch information
jedisct1 committed Mar 24, 2020
1 parent 2670caa commit 315f6f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dnscrypt-proxy/serversInfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
2 changes: 1 addition & 1 deletion dnscrypt-proxy/xtransport.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
Expand Down

0 comments on commit 315f6f4

Please sign in to comment.