-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Tim-ats-d <[email protected]>
- Loading branch information
Showing
9 changed files
with
69 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,3 +31,7 @@ _opam/ | |
|
||
# Certificates | ||
*.pem | ||
|
||
# Sublime Text | ||
*.sublime-project | ||
*.sublime-workspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
let router = | ||
Mehari_eio.router | ||
[ | ||
Mehari_eio.route "/" (fun req -> | ||
match Mehari.client_cert req with | ||
| [] -> Mehari.(response client_cert_req) "Certificate plz" | ||
| hd :: _ -> | ||
X509.Certificate.encode_pem hd | ||
|> Cstruct.to_string | ||
|> Printf.sprintf "Client certificate ~nyoron\n%s" | ||
|> Mehari.response_text); | ||
] | ||
|
||
let main ~net ~cwd = | ||
Mehari_eio.run net | ||
~certchains:Eio.Path.[ (cwd / "cert.pem", cwd / "key.pem") ] | ||
router | ||
|
||
let () = | ||
Eio_main.run @@ fun env -> | ||
Mirage_crypto_rng_eio.run (module Mirage_crypto_rng.Fortuna) env @@ fun () -> | ||
main ~net:env#net ~cwd:env#cwd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,5 @@ | |
magic-mime | ||
mirage-clock | ||
uri | ||
zed)) | ||
zed | ||
x509)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters