Skip to content

Commit

Permalink
Merge pull request #594 from hannesm/x509-0162
Browse files Browse the repository at this point in the history
Git_mirage_http: the authenticator format description has been incorporated into x509 0.16.2, use this
  • Loading branch information
dinosaure authored Oct 8, 2022
2 parents 6c5f401 + bfb352b commit 4f15d65
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
2 changes: 1 addition & 1 deletion git-mirage.opam
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ depends: [
"ca-certs-nss"
"mirage-crypto"
"ptime"
"x509"
"x509" {>= "0.16.2"}
"cstruct"
"tcpip" {>= "7.0.0"}
"domain-name" {>= "0.3.0"}
Expand Down
17 changes: 1 addition & 16 deletions src/git-mirage/git_mirage_http.ml
Original file line number Diff line number Diff line change
Expand Up @@ -272,22 +272,7 @@ struct
| Some str -> (
match X509.Authenticator.of_string str with
| Ok auth -> auth time
| Error (`Msg _) ->
Fmt.failwith
"Invalid TLS authenticator: %S\n\
The format of it is:\n\
- [none]: no authentication\n\
- [key-fp(:<hash>?):<base64-encoded fingerprint>]: to \
authenticate a peer via its key fingerprintf (hash is \
optional and defaults to SHA256)\n\
- [cert-fp(:<hash>?):<base64-encoded fingerprint>]: to \
authenticate a peer via its certificate fingerprint (hash is \
optional and defaults to SHA256)\n\
- [trust-anchor(:<base64-encoded DER certificate>)+] to \
authenticate a peer from a list of certificates (certificate \
must be in PEM format witthout header and footer (----BEGIN \
CERTIFICATE----) and without newlines).\n"
str)
| Error (`Msg msg) -> failwith msg)
in
let tls = Tls.Config.client ~authenticator () in
let ctx = Mimic.add git_mirage_http_tls_config tls ctx in
Expand Down

0 comments on commit 4f15d65

Please sign in to comment.