Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crate doc comment is incorrect and references function that doesn't exist #37

Closed
wfraser opened this issue Dec 11, 2021 · 2 comments · Fixed by #38
Closed

crate doc comment is incorrect and references function that doesn't exist #37

wfraser opened this issue Dec 11, 2021 · 2 comments · Fixed by #38

Comments

@wfraser
Copy link

wfraser commented Dec 11, 2021

See:

//! It provides the following functions:
//! * A higher level function [load_native_certs](fn.build_native_certs.html)
//! which returns a `rustls::RootCertStore` pre-filled from the native
//! certificate store. It is only available if the `rustls` feature is
//! enabled.
//! * A lower level function [build_native_certs](fn.build_native_certs.html)
//! that lets callers pass their own certificate parsing logic. It is
//! available to all users.

build_native_certs is gone, and load_native_certs doesn't return a RootCertStore any more.

Consider replacing this with the snippet in the example:

    let mut roots = rustls::RootCertStore::empty();
    for cert in rustls_native_certs::load_native_certs().expect("could not load platform certs") {
        roots
            .add(&rustls::Certificate(cert.0))
            .unwrap();
    }

It was not very obvious to me how to upgrade this crate without digging into the examples to figure out how to turn a vec of certificates into a RootCertStore.

@djc
Copy link
Member

djc commented Dec 13, 2021

Oops, thanks for the bug report. Do the changes proposed in #38 make things clearer? If you have any suggestions about how to further improve things, that would be much appreciated.

@wfraser
Copy link
Author

wfraser commented Dec 13, 2021

Yeah, that looks great. Thanks!

@ctz ctz closed this as completed in #38 Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants