@@ -165,7 +165,7 @@ func (c *WebSocketConfig) Build() (proto.Message, error) {
165
165
}
166
166
// Priority (client): host > serverName > address
167
167
for k , v := range c .Headers {
168
- if strings .ToLower (k ) == "host" {
168
+ if strings .ToLower (k ) == "host" {
169
169
errors .PrintDeprecatedFeatureWarning (`"host" in "headers"` , `independent "host"` )
170
170
if c .Host == "" {
171
171
c .Host = v
@@ -438,7 +438,7 @@ func (c *TLSConfig) Build() (proto.Message, error) {
438
438
config .MaxVersion = c .MaxVersion
439
439
config .CipherSuites = c .CipherSuites
440
440
config .Fingerprint = strings .ToLower (c .Fingerprint )
441
- if config .Fingerprint != "" && tls .GetFingerprint (config .Fingerprint ) == nil {
441
+ if config .Fingerprint != "unsafe " && tls .GetFingerprint (config .Fingerprint ) == nil {
442
442
return nil , errors .New (`unknown fingerprint: ` , config .Fingerprint )
443
443
}
444
444
config .RejectUnknownSni = c .RejectUnknownSNI
@@ -584,15 +584,13 @@ func (c *REALITYConfig) Build() (proto.Message, error) {
584
584
config .ServerNames = c .ServerNames
585
585
config .MaxTimeDiff = c .MaxTimeDiff
586
586
} else {
587
- if c .Fingerprint == "" {
588
- return nil , errors .New (`empty "fingerprint"` )
587
+ config .Fingerprint = strings .ToLower (c .Fingerprint )
588
+ if config .Fingerprint == "unsafe" || config .Fingerprint == "hellogolang" {
589
+ return nil , errors .New (`invalid "fingerprint": ` , config .Fingerprint )
589
590
}
590
- if config . Fingerprint = strings . ToLower ( c . Fingerprint ); tls .GetFingerprint (config .Fingerprint ) == nil {
591
+ if tls .GetFingerprint (config .Fingerprint ) == nil {
591
592
return nil , errors .New (`unknown "fingerprint": ` , config .Fingerprint )
592
593
}
593
- if config .Fingerprint == "hellogolang" {
594
- return nil , errors .New (`invalid "fingerprint": ` , config .Fingerprint )
595
- }
596
594
if len (c .ServerNames ) != 0 {
597
595
return nil , errors .New (`non-empty "serverNames", please use "serverName" instead` )
598
596
}
0 commit comments