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

Rewrite ACME issuer for v2, and make validation process asynchronous #309

Merged
merged 110 commits into from
Apr 12, 2018

Conversation

munnerz
Copy link
Member

@munnerz munnerz commented Feb 9, 2018

What this PR does / why we need it:

Adds support for the ACME v2 protocol in favour of v1

Which issue this PR fixes: fixes #273

Special notes for your reviewer:

This PR is not ready yet. We need to validate and ensure boulder runs with the v2 protocol enabled during our e2e tests. In future we can switch to something like pebble, a lightweight alternative to boulder.

I've updated the PR to use Pebble instead of Boulder during e2e tests

I have also copied across the upcoming golang.org/x/crypto/acme/v2 package from the gerrit codereview so we can get ahead of the curve on testing this: https://go-review.googlesource.com/c/crypto/+/86635

I have also not tested whether it is possible to obtain wildcard certificates with this yet
I have managed to obtain a wildcard certificate with this PR!

Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            fa:f5:cc:92:f2:02:15:58:37:05:02:9f:bf:53:9f:9c:d4:0c
    Signature Algorithm: sha256WithRSAEncryption
        Issuer: CN=Fake LE Intermediate X1
        Validity
            Not Before: Mar 23 15:56:39 2018 GMT
            Not After : Jun 21 15:56:39 2018 GMT
        Subject: CN=*.james-gcp.redacted.net
        Subject Public Key Info:

Release note:

Remove support for ACMEv1 in favour of ACMEv2

@jetstack-bot jetstack-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Feb 9, 2018
@munnerz munnerz changed the title Rewrite ACME issuer for v2, and make validation process asynchronous WIP: Rewrite ACME issuer for v2, and make validation process asynchronous Feb 9, 2018
@jetstack-bot jetstack-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 9, 2018
@munnerz
Copy link
Member Author

munnerz commented Feb 10, 2018

Still TODO: As part of making the authorization process asynchronous we need to make the DNS and HTTP01 challenge solver idempotent (so the names of resources it creates must be looked up instead of stored in memory)

@munnerz
Copy link
Member Author

munnerz commented Feb 10, 2018

/retest

@munnerz
Copy link
Member Author

munnerz commented Feb 12, 2018

Currently failing due to the aforementioned TODO:

Still TODO: As part of making the authorization process asynchronous we need to make the DNS and HTTP01 challenge solver idempotent (so the names of resources it creates must be looked up instead of stored in memory)

Also waiting for this to merge in Pebble: letsencrypt/pebble#94

@cpu
Copy link
Contributor

cpu commented Feb 12, 2018

Also waiting for this to merge in Pebble: letsencrypt/pebble#94

@munnerz That's on my plate for today 👍

@markns
Copy link

markns commented Feb 18, 2018

Hey @munnerz, I know you've marked this PR as not ready yet, but I was super-keen to try it out, so went ahead and compiled it myself. It didn't work for me, because the https://acme-staging-v02.api.letsencrypt.org/acme/new-acct endpoint was returning HTTP 200, but with an empty body which caused the decoding at third_party/crypto/acme/acme.go:556 to fail.

I0218 16:53:19.071128   82052 acme.go:105] getting private key (letsencrypt-staging->tls.key) for acme issuer cert-manager/letsencrypt-staging-cluster-issuer-v2
I0218 16:53:19.909230   82052 setup.go:59] letsencrypt-staging-cluster-issuer-v2: Failed to verify ACME account: acme: invalid response: EOF
I0218 16:53:19.909303   82052 helpers.go:112] Setting lastTransitionTime for ClusterIssuer "letsencrypt-staging-cluster-issuer-v2" condition "Ready" to 2018-02-18 16:53:19.909295374 +0100 CET m=+15.560314114
I0218 16:53:19.909332   82052 sync.go:40] Error initializing issuer: acme: invalid response: EOF

Feel free to ignore if you're already aware of this, but I thought it was a bit weird so thought I'd let you know.

Here's my cluster issuer yaml:

kind: ClusterIssuer
metadata:
  name: letsencrypt-staging-cluster-issuer-v2
spec:
  acme:
    server: https://acme-staging-v02.api.letsencrypt.org/directory
    email: cert@gridarrow.io
    privateKeySecretRef:
      name: letsencrypt-staging
    http01: {}

@munnerz
Copy link
Member Author

munnerz commented Feb 18, 2018 via email

@munnerz munnerz added this to the v0.3 milestone Feb 21, 2018
@munnerz
Copy link
Member Author

munnerz commented Feb 21, 2018

Follow up (just remembered there's another significant part of this PR that will make it not work):

Still TODO: As part of making the authorization process asynchronous we need to make the DNS and HTTP01 challenge solver idempotent (so the names of resources it creates must be looked up instead of stored in memory).

Until this is done, when using HTTP01 you'll see hundreds of acmesolver pods created so please do not use this on a production cluster 😄

@jetstack-ci-bot
Copy link
Contributor

@munnerz PR needs rebase

@jetstack-ci-bot jetstack-ci-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 22, 2018
@jetstack-ci-bot jetstack-ci-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 27, 2018
@munnerz munnerz force-pushed the acmev2 branch 3 times, most recently from a0df9f5 to 6d72597 Compare March 12, 2018 17:25
@munnerz
Copy link
Member Author

munnerz commented Apr 11, 2018

/retest

1 similar comment
@munnerz
Copy link
Member Author

munnerz commented Apr 11, 2018

/retest

Fixes for ACME client http transport
@munnerz
Copy link
Member Author

munnerz commented Apr 11, 2018

/retest

@munnerz
Copy link
Member Author

munnerz commented Apr 12, 2018

/retest

@munnerz
Copy link
Member Author

munnerz commented Apr 12, 2018

Re running tests with cloudflare dns01 provider tests enabled

/test e2e

@jetstack-bot
Copy link
Contributor

jetstack-bot commented Apr 12, 2018

@munnerz: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
cert-manager-e2e-v1-10 acd927d link /test e2e v1.10

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@munnerz
Copy link
Member Author

munnerz commented Apr 12, 2018

/skip

Copy link
Contributor

@kragniz kragniz left a comment

Choose a reason for hiding this comment

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

/lgtm

@jetstack-bot jetstack-bot added the lgtm Indicates that a PR is ready to be merged. label Apr 12, 2018
@jetstack-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kragniz

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jetstack-bot jetstack-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 12, 2018
@jetstack-bot jetstack-bot merged commit 9cebaa6 into cert-manager:master Apr 12, 2018
@munnerz munnerz deleted the acmev2 branch January 29, 2019 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wildcard certificates support