XTLS/Xray-core · error
failed to create certificate
Error message
failed to create certificate
What it means
Error "failed to create certificate" thrown in XTLS/Xray-core.
Source
Thrown at common/protocol/tls/cert/cert.go:173
return nil, errors.New("failed to parse parent certificate").Base(err)
}
parentCert = pCert
}
if parentCert.NotAfter.Before(template.NotAfter) {
template.NotAfter = parentCert.NotAfter
}
if parentCert.NotBefore.After(template.NotBefore) {
template.NotBefore = parentCert.NotBefore
}
for _, opt := range opts {
opt(template)
}
derBytes, err := x509.CreateCertificate(rand.Reader, template, parentCert, publicKey(selfKey), parentKey)
if err != nil {
return nil, errors.New("failed to create certificate").Base(err)
}
privateKey, err := x509.MarshalPKCS8PrivateKey(selfKey)
if err != nil {
return nil, errors.New("Unable to marshal private key").Base(err)
}
return &Certificate{
Certificate: derBytes,
PrivateKey: privateKey,
}, nil
}
View on GitHub (pinned to 7d214f8b09)
When it happens
Trigger: Thrown at common/protocol/tls/cert/cert.go:173 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- SSL/TLS and certificate errors — how TLS handshakes and certificate validation fail.
AI-assisted analysis of XTLS/Xray-core@7d214f8b09 (2026-08-15).
Data as JSON: /api/errors/2dda13a1ee319525.
Report an issue: GitHub.