Description
We're working on an lnd
gRPC client in Rust, using rustls, and rustls
doesn't accept the self-signed certificates generated by LND 0.13.0-beta.
The error reported by rustls
, WebPKIError(CAUsedAsEndEntity)
, is caused by lnd
's certificate being a CA certificate, when servers should present end-entity certificates.
These certificates work with OpenSSL (which we assume other client implementations are using), and we're trying to figure out the difference in behavior, cf. https://github.com/briansmith/webpki/issues/114#issuecomment-870941157. We're not totally sure, but we think that OpenSSL just doesn't check that servers present end-entity certificates, when according to the spec it should.
We think the solution would be to make lnd
generate both a CA cert (e.g. ca.cert
) and an end-entity cert (e.g. ee.cert
) signed by that CA. Clients would then add ca.cert
as a trusted root certificate, and would then accept ee.cert
when presented by lnd
.