RusTLS would be a good option here, but I couldn't find the necessary functions while working on this initially. Turns out, https://docs.rs/rustls/latest/rustls/client/struct.WebPkiVerifier.html#method.verify_server_cert exists and does what we want it to do, so it would be very well possible to work with native things only, getting rid of our dependency on openssl.
RusTLS would be a good option here, but I couldn't find the necessary functions while working on this initially. Turns out, https://docs.rs/rustls/latest/rustls/client/struct.WebPkiVerifier.html#method.verify_server_cert exists and does what we want it to do, so it would be very well possible to work with native things only, getting rid of our dependency on openssl.