mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-07-02 01:43:25 +00:00
Commands: Print leaf cert's SHA256 in tls ping (#5628)
And https://github.com/XTLS/Xray-core/pull/5628#issuecomment-3828445442 --------- Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
This commit is contained in:
@@ -639,10 +639,14 @@ func (c *TLSConfig) Build() (proto.Message, error) {
|
||||
if v == "" {
|
||||
continue
|
||||
}
|
||||
hashValue, err := hex.DecodeString(v)
|
||||
// remove colons for OpenSSL format
|
||||
hashValue, err := hex.DecodeString(strings.ReplaceAll(v, ":", ""))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(hashValue) != 32 {
|
||||
return nil, errors.New("incorrect pinnedPeerCertSha256 length: ", v)
|
||||
}
|
||||
config.PinnedPeerCertSha256 = append(config.PinnedPeerCertSha256, hashValue)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user