You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/book/src/quinn/certificate.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,13 +19,13 @@ rustls = { version = "*", features = ["dangerous_configuration", "quic"] }
19
19
Then, allow the client to skip the certificate validation by implementing [ServerCertVerifier][ServerCertVerifier] and letting it assert verification for any server.
20
20
21
21
```rust
22
-
{{#include../bin/certificate.rs:16:68}}
22
+
{{#include../bin/certificate.rs:36:88}}
23
23
```
24
24
25
25
After that, modify the [ClientConfig][ClientConfig] to use this [ServerCertVerifier][ServerCertVerifier] implementation.
26
26
27
27
```rust
28
-
{{#include../bin/certificate.rs:71:80}}
28
+
{{#include../bin/certificate.rs:25:34}}
29
29
```
30
30
31
31
Finally, if you plug this [ClientConfig][ClientConfig] into the [Endpoint::set_default_client_config()][set_default_client_config] your client endpoint should verify all connections as trustworthy.
@@ -45,7 +45,7 @@ This example uses [rcgen][4] to generate a certificate.
45
45
Let's look at an example:
46
46
47
47
```rust
48
-
{{#include../bin/certificate.rs:92:98}}
48
+
{{#include../bin/certificate.rs:90:96}}
49
49
```
50
50
51
51
_Note that [generate_simple_self_signed][generate_simple_self_signed] returns a [Certificate][2] that can be serialized to both `.der` and `.pem` formats._
@@ -68,7 +68,7 @@ certbot asks for the required data and writes the certificates to `fullchain.pem
68
68
These files can then be referenced in code.
69
69
70
70
```rust
71
-
{{#include../bin/certificate.rs:82:90}}
71
+
{{#include../bin/certificate.rs:98:106}}
72
72
```
73
73
74
74
### Configuring Certificates
@@ -79,15 +79,15 @@ After configuring plug the configuration into the `Endpoint`.
79
79
**Configure Server**
80
80
81
81
```rust
82
-
{{#include../bin/certificate.rs:104}}
82
+
{{#include../bin/certificate.rs:20}}
83
83
```
84
84
85
85
This is the only thing you need to do for your server to be secured.
86
86
87
87
**Configure Client**
88
88
89
89
```rust
90
-
{{#include../bin/certificate.rs:105}}
90
+
{{#include../bin/certificate.rs:21}}
91
91
```
92
92
93
93
This is the only thing you need to do for your client to trust a server certificate signed by a conventional certificate authority.
0 commit comments