1
0
mirror of https://github.com/actix/examples synced 2024-11-23 14:31:07 +01:00
examples/https-tls/rustls-client-cert
2024-05-25 05:36:36 +01:00
..
certs restructure folders 2022-02-18 02:01:48 +00:00
src chore: upgrade to rustls v0.23 2024-05-25 05:36:36 +01:00
Cargo.toml chore: upgrade to rustls v0.23 2024-05-25 05:36:36 +01:00
README.md fix: directory path should be https-tls (#689) 2023-12-29 12:25:15 +00:00

TLS Client Certificate (using 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

cd https-tls/rustls-client-cert
cargo run

The server runs HTTP on port 8080 and HTTPS on port 8443.

Providing Client Cert

Using HTTPie:

http https://127.0.0.1:8443/ --verify=certs/rootCA.pem --cert=certs/client-cert.pem --cert-key=certs/client-key.pem

Using cURL:

curl https://127.0.0.1:8443/ --cacert certs/rootCA.pem --cert certs/client-cert.pem --key certs/client-key.pem