Skip to content

Commit

Permalink
dns-certify: allow [`raw] Domain_name.t in signing requests
Browse files Browse the repository at this point in the history
The previous restriction for [`host] Domain_name.t disallows to request
wildcard certificates. In a X509 sisning request and certificate, the
subjectAlternativeName (of typ DNS) is a string list (since General_name.t
is used for NameConstraints (allowing leading dot, IP addresses, IP/netmask)).
  • Loading branch information
hannesm committed Jan 6, 2021
1 parent b9bb934 commit d0e90bb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/ocertify.ml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ let hostname =

let more_hostnames =
let doc = "Additional hostnames to be included in the certificate as SubjectAlternativeName extension" in
Arg.(value & opt_all Dns_cli.name_c [] & info ["additional"] ~doc ~docv:"HOSTNAME")
Arg.(value & opt_all Dns_cli.domain_name_c [] & info ["additional"] ~doc ~docv:"HOSTNAME")

let csr =
let doc = "certificate signing request filename (defaults to hostname.req)" in
Expand Down
2 changes: 1 addition & 1 deletion certify/dns_certify.mli
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
open Dns

val signing_request : [`host] Domain_name.t ->
?more_hostnames:([`host] Domain_name.t list) ->
?more_hostnames:([`raw] Domain_name.t list) ->
X509.Private_key.t -> X509.Signing_request.t
(** [signing_request name ~more_hostnames key] creates a X509 signing request
where [name] will be the common name in its subject, and if [more_hostnames]
Expand Down
2 changes: 1 addition & 1 deletion mirage/certify/dns_certify_mirage.mli
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Make (R : Mirage_random.S) (P : Mirage_clock.PCLOCK) (T : Mirage_time.S)

val retrieve_certificate :
S.t -> dns_key:string -> hostname:[ `host ] Domain_name.t ->
?additional_hostnames:[ `host ] Domain_name.t list -> ?key_seed:string ->
?additional_hostnames:[ `raw ] Domain_name.t list -> ?key_seed:string ->
S.TCPV4.ipaddr -> int -> (Tls.Config.own_cert, [ `Msg of string ]) result Lwt.t
(** [retrieve_certificate stack ~dns_key ~hostname ~key_seed server_ip port]
generates a RSA private key (using the [key_seed]), a certificate
Expand Down

0 comments on commit d0e90bb

Please sign in to comment.