Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revise dns_certify with new ACME / let's encrypt in mind #219

Merged
merged 6 commits into from
Mar 13, 2020

Conversation

hannesm
Copy link
Member

@hannesm hannesm commented Feb 19, 2020

the main change is that let's encrypt now very conveniently provides the chain of trust as well as the end-entity certificate. this means that we no longer need to carry the hard-coded certificate around. but this implies that we need to store the CA chain somewhere (again, as TLSA records :)

I'm still not entirely happy with the dns_certify API, but I think this is moving into the right direction.

@hannesm
Copy link
Member Author

hannesm commented Feb 19, 2020

once this is in and tested successfully, I'd like to go ahead and draft a release unless there are objections

Copy link
Contributor

@cfcs cfcs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine, left some questions

| Ok cert ->
if is_certificate tlsa then
(cert :: certs, cacerts)
else (* must be is_ca_certificate *)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this comment suggest we should check for is_ca_certificate ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's checked some lines above.. this code will only ever be executed if either is_certificate or is_ca_certificate is true.. checking it here again means I'd need to handle the impossible case of neither being true, which I'd like to avoid (but the code may be refactored for good to avoid these cases)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be good if the comment could explain that (I was a bit unsure if must be meant "we can logically derive that it is because we just checked" or "it really really should be, but we don't know if it is")

(cert :: certs, cacerts)
else (* must be is_ca_certificate *)
(certs, cert :: cacerts)
| _ -> acc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here we ignore the parsing Error _ ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this is a shortcoming of the code (but the same behaviour as previously). maybe best to emit a log message..

…ate, is_ca_certificate, is_name

since ACME v2 the certificate chain is part of the provisioning:
  - no need to hardcode the certificates in Dns_certificy_mirage anymore
  - use the CA certificates from dns (TLSA records again)
Copy link
Contributor

@cfcs cfcs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small suggestions / questions, otherwise looks good :)

test/server.ml Outdated Show resolved Hide resolved
test/dune Outdated Show resolved Hide resolved
certify/dns_certify.mli Outdated Show resolved Hide resolved
Co-Authored-By: C For C's Sake <cfcs@users.noreply.github.com>
@hannesm hannesm merged commit d5c369f into mirage:master Mar 13, 2020
@hannesm hannesm deleted the certify branch March 13, 2020 21:40
hannesm added a commit to hannesm/opam-repository that referenced this pull request Mar 13, 2020
…ns-client, dns-server, dns-tsig and dns-cli (4.4.0)

CHANGES:

* dns-stub, a new opam package, is a stub resolver mirage/ocaml-dns#209 @hannesm, review by
  @cfcs
* embed IP address of recursive resolver only once mirage/ocaml-dns#214 @hannesm, fixes mirage/ocaml-dns#210,
  review by @cfcs
* Dns_trie.lookup returns NotAuthoritative if no SOA is present mirage/ocaml-dns#217 @hannesm,
  review by @cfcs
* Secondary server is looked up in trie properly (may be in another zone, which
  primary is not authoritative for the other zone) mirage/ocaml-dns#217 @hannesm, review by
  @cfcs
* new function Dns.Dnskey.pp_name_key mirage/ocaml-dns#218 @hannesm, review by @cfcs
* dns-certify uses new ACME protocol (where the intermediate certificate is
  part of the issuance process) mirage/ocaml-dns#219 @hannesm, review by @cfcs
* dns-certify/dns-tsig/dns-cli: use mirage-crypto mirage/ocaml-dns#219 @hannesm, review by @cfcs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants