瀏覽代碼

transport: warn on user-provided CA

ServerName is ignored for a user-provided CA for backwards compatibility. This
breaks PKI, so warn it is deprecated.
Anthony Romano 9 年之前
父節點
當前提交
da8fd18d8e
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      pkg/transport/listener.go

+ 2 - 0
pkg/transport/listener.go

@@ -23,6 +23,7 @@ import (
 	"crypto/x509/pkix"
 	"encoding/pem"
 	"fmt"
+	"log"
 	"math/big"
 	"net"
 	"os"
@@ -235,6 +236,7 @@ func (info TLSInfo) ClientConfig() (*tls.Config, error) {
 			return nil, err
 		}
 		// if given a CA, trust any host with a cert signed by the CA
+		log.Println("warning: ignoring ServerName for user-provided CA for backwards compatibility is deprecated")
 		cfg.ServerName = ""
 	}