proxy: optimize NewConn, avoid loop

This commit is contained in:
nadoo committed 2020-10-11 18:46:15 +08:00
1 parent 40ddd1be3a
commit 6fff126e4b
6 files changed
+14 -13

No files matched your search

+4
View File
@@ -96,6 +96,10 @@ func NewTLSServer(s string, p proxy.Proxy) (proxy.Server, error) {
return nil, err
}
if t.certFile == "" || t.keyFile == "" {
return nil, errors.New("[tls] cert and key file path must be spcified")
}
cert, err := stdtls.LoadX509KeyPair(t.certFile, t.keyFile)
if err != nil {
log.F("[tls] unable to load cert: %s, key %s", t.certFile, t.keyFile)