mirror of
https://github.com/cmz0228/hysteria-dev.git
synced 2025-06-08 05:19:53 +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,10 +94,13 @@ func (l *LocalCertificateLoader) makeCache() (cache *localCertificateCache, err
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
c.certificate = &cert
|
c.certificate = &cert
|
||||||
|
if c.certificate.Leaf == nil {
|
||||||
|
// certificate.Leaf was left nil by tls.LoadX509KeyPair before Go 1.23
|
||||||
c.certificate.Leaf, err = x509.ParseCertificate(cert.Certificate[0])
|
c.certificate.Leaf, err = x509.ParseCertificate(cert.Certificate[0])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
cache = c
|
cache = c
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user