1
0
mirror of https://github.com/actix/examples synced 2024-11-27 16:02:57 +01:00
examples/security/rustls-client-cert/README.md

35 lines
851 B
Markdown
Raw Normal View History

2020-10-30 05:22:24 +01:00
# Access Client Certificate (via Rustls)
## Usage
### Certificate
All the self-signed certificate are in the ./certs directory, including the CA certificate
generated by [`mkcert`] that was used to create the server and client certs.
### Server
```sh
cd examples/rustls-client-cert
cargo run
```
The server runs HTTP on port 8080 and HTTPS on port 8443.
### Providing Client Cert
Using [HTTPie]:
```sh
# `--verify=false` used because HTTPie doesn't have an option to provide the CA cert
http https://127.0.0.1:8443/ --verify=false --cert=certs/client-cert.pem --cert-key=certs/client-key.pem
```
Using [cURL]:
```sh
curl https://127.0.0.1:8443/ --cacert certs/rootCA.pem --cert certs/client-cert.pem --key certs/client-key.pem
```
[`mkcert`]: https://github.com/FiloSottile/mkcert
[cURL]: https://curl.haxx.se/
[HTTPie]: https://httpie.org/