mirror of
https://github.com/cedar2025/hysteria.git
synced 2025-06-07 21:09:55 +00:00
chore: only init cert.Leaf when not populated
since Go 1.23, cert.Leaf will be populated after loaded. see doc of tls.LoadX509KeyPair for details
This commit is contained in:
parent
45893b5d1e
commit
bcf830c29a
@ -94,9 +94,12 @@ func (l *LocalCertificateLoader) makeCache() (cache *localCertificateCache, err
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
c.certificate = &cert
|
c.certificate = &cert
|
||||||
c.certificate.Leaf, err = x509.ParseCertificate(cert.Certificate[0])
|
if c.certificate.Leaf == nil {
|
||||||
if err != nil {
|
// certificate.Leaf was left nil by tls.LoadX509KeyPair before Go 1.23
|
||||||
return
|
c.certificate.Leaf, err = x509.ParseCertificate(cert.Certificate[0])
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cache = c
|
cache = c
|
||||||
|
Loading…
x
Reference in New Issue
Block a user