1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-04-16 18:49:16 -04:00

added calculation of certificate hash as separate command and tlsping, use base64 to represent fingerprint to align with jsonPb

This commit is contained in:
Shelikhoo
2021-04-15 19:01:55 +01:00
parent 34a3850f16
commit 92b845a45b
3 changed files with 79 additions and 10 deletions

View File

@@ -7,7 +7,7 @@ import (
"crypto/sha256"
"crypto/tls"
"crypto/x509"
"encoding/hex"
"encoding/base64"
"strings"
"sync"
"time"
@@ -181,7 +181,7 @@ func (c *Config) verifyPeerCert(rawCerts [][]byte, verifiedChains [][]*x509.Cert
return nil
}
}
return newError("peer cert is unrecognized: ", hex.EncodeToString(hashValue))
return newError("peer cert is unrecognized: ", base64.StdEncoding.EncodeToString(hashValue))
}
return nil
}