You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What happened:
When presenting a client certificate with an intermediate certificate, the error x509: certificate signed by unknown authority is returned despite the chain being correct.
In verifyClientCertificate the intermediate certificates are iterated upon and then added here:
However, the contents of rawCerts is not PEM-encoded, but ASN.1 raw binary data. Because the result of AppendCertsFromPEM is not checked, the error goes unnoticed. The certificates should instead be handled as raw binary data, such as in the example below:
for i, cert := range rawCerts[1:] {
c, err := x509.ParseCertificate(cert)
if err != nil {
logger.WithError(err).Warning("cannot parse intermediate certificate")
return errors.New("bad client certificate: " + err.Error())
}
opts.Intermediates.AddCert(c)
}
What you expected to happen:
I expected the intermediate certificate to be properly handled as binary data.
How to reproduce it (as minimally and precisely as possible):
Create a Root CA
Create an Intermediate CA
Create a client certificate from the Intermediate CA
Attach the Intermediate CA's public key to the client certificate's public key
Configure the Root CA (do not add the Intermediate CA) as the Allocation Client CA
Configure a GRPC client (in my case) to connect to the Agones Allocator GRPC server
Connect
Anything else we need to know?:
Environment:
Agones version: 1.19.0 (but I have referenced the code in the main branch when I reproduced the error locally)
Kubernetes version (use kubectl version): v1.21.11-gke.1100
Cloud provider or hardware configuration: GKE
Install method (yaml/helm): helm
The text was updated successfully, but these errors were encountered:
What happened:
When presenting a client certificate with an intermediate certificate, the error
x509: certificate signed by unknown authority
is returned despite the chain being correct.In
verifyClientCertificate
the intermediate certificates are iterated upon and then added here:agones/cmd/allocator/main.go
Line 416 in 8062a04
However, the contents of
rawCerts
is not PEM-encoded, but ASN.1 raw binary data. Because the result ofAppendCertsFromPEM
is not checked, the error goes unnoticed. The certificates should instead be handled as raw binary data, such as in the example below:What you expected to happen:
I expected the intermediate certificate to be properly handled as binary data.
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
Environment:
kubectl version
): v1.21.11-gke.1100The text was updated successfully, but these errors were encountered: