Skip to content

Commit

Permalink
Use fullchain.pem in the certbot example
Browse files Browse the repository at this point in the history
  • Loading branch information
DontBreakAlex authored and Ralith committed May 27, 2023
1 parent ede4344 commit 33e3f16
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/book/src/quinn/certificate.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ certbot must answer a cryptographic challenge of the Let's Encrypt API to prove
It needs to listen on port 80 (HTTP) or 443 (HTTPS) to achieve this. Open the appropriate port in your firewall and router.

If certbot is installed, run `certbot certonly --standalone`, this command will start a web server in the background and start the challenge.
certbot asks for the required data and writes the certificate to `cert.pem` and the private key to `privkey.pem`.
certbot asks for the required data and writes the certificates to `fullchain.pem` and the private key to `privkey.pem`.
These files can then be referenced in code.

```rust
use std::{error::Error, fs::File, io::BufReader};

pub fn read_certs_from_file(
) -> Result<(Vec<rustls::Certificate>, rustls::PrivateKey), Box<dyn Error>> {
let mut cert_chain_reader = BufReader::new(File::open("./certificates.pem")?);
let mut cert_chain_reader = BufReader::new(File::open("./fullchain.pem")?);
let certs = rustls_pemfile::certs(&mut cert_chain_reader)?
.into_iter()
.map(rustls::Certificate)
Expand Down

0 comments on commit 33e3f16

Please sign in to comment.