Skip to content

Add an example to print trust anchors.#24

Merged
djc merged 1 commit into
rustls:mainfrom
jsha:printer
Oct 13, 2021
Merged

Add an example to print trust anchors.#24
djc merged 1 commit into
rustls:mainfrom
jsha:printer

Conversation

@jsha

@jsha jsha commented May 27, 2021

Copy link
Copy Markdown
Contributor

Also remove a ; that was breaking compile for me.

Comment thread examples/print-trust-anchors.rs Outdated
@@ -0,0 +1,29 @@
// Print the Subject of all extracted trust anchors.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably be an inner attribute (that is, start with //!).

Comment thread examples/print-trust-anchors.rs Outdated
use std::io::{BufRead, Error};
use x509_parser::prelude::*;

struct Printer {}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this, makes sense to replace {} with just ;.

Comment thread examples/print-trust-anchors.rs Outdated
println!("{}", cert.tbs_certificate.subject);
Ok(())
}
fn load_pem_file(&mut self, rd: &mut dyn BufRead) -> Result<(), Error> {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally add an empty line between these two methods.

@djc

djc commented Oct 11, 2021

Copy link
Copy Markdown
Member

@jsha are you interested in rebasing this for the next release?

@jsha jsha force-pushed the printer branch 2 times, most recently from 0aa1c18 to 3b23214 Compare October 11, 2021 16:50
@jsha

jsha commented Oct 11, 2021

Copy link
Copy Markdown
Contributor Author

Done!

Comment thread examples/print-trust-anchors.rs
@djc djc merged commit ccdac5d into rustls:main Oct 13, 2021
@djc

djc commented Oct 13, 2021

Copy link
Copy Markdown
Member

Thanks!

@jsha jsha deleted the printer branch June 12, 2022 16:14
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 this pull request may close these issues.

2 participants