mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-07-03 10:18:42 +00:00
Fix AUTHORITY_VERIFY
This commit is contained in:
@@ -38,6 +38,9 @@ func ParseCertificate(c *cert.Certificate) *Certificate {
|
||||
func (c *Config) loadSelfCertPool() (*x509.CertPool, error) {
|
||||
root := x509.NewCertPool()
|
||||
for _, cert := range c.Certificate {
|
||||
if cert.Usage != Certificate_AUTHORITY_VERIFY {
|
||||
continue
|
||||
}
|
||||
if !root.AppendCertsFromPEM(cert.Certificate) {
|
||||
return nil, errors.New("failed to append cert").AtWarning()
|
||||
}
|
||||
|
||||
@@ -47,6 +47,9 @@ func (c *Config) getCertPool() (*x509.CertPool, error) {
|
||||
return nil, errors.New("system root").AtWarning().Base(err)
|
||||
}
|
||||
for _, cert := range c.Certificate {
|
||||
if cert.Usage != Certificate_AUTHORITY_VERIFY {
|
||||
continue
|
||||
}
|
||||
if !pool.AppendCertsFromPEM(cert.Certificate) {
|
||||
return nil, errors.New("append cert to root").AtWarning().Base(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user