libunftp icon indicating copy to clipboard operation
libunftp copied to clipboard

Upgrade to rustls 0.22 breaks access to cert details

Open robklg opened this issue 1 year ago • 0 comments

@hannesdejager maybe I'm overlooking something, but I'm looking into upgrading to rustls 0.22.

Here:

https://github.com/bolcom/libunftp/blob/edd1b6ed6020a829896baa8ff6f5d69e59f6a734/src/server/controlchan/control_loop.rs#L251

we copy the certificate bytes and we need it later for matching the client certificate here:

https://github.com/bolcom/libunftp/blob/edd1b6ed6020a829896baa8ff6f5d69e59f6a734/src/auth/authenticator.rs#L104-L113

But since rustls 0.22.0 peer_certificates no longer returns rustls::Certificate but it was replaced by CertificateDer from a new crate rustls_pki_types. CertificateDer does not allow access to the certificate data, so we cannot convert it to our ClientCert.

Do you have any idea how we can solve this, or do we need to raise an issue with rustls_pki_types?

robklg avatar Feb 14 '24 20:02 robklg