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

Use ACME version 2 #104

Closed
wants to merge 28 commits into from
Closed

Use ACME version 2 #104

wants to merge 28 commits into from

Conversation

r5d
Copy link

@r5d r5d commented Feb 2, 2020

This PR refactors both sign_csr.py and revoke_crt.py to use ACME version 2.

Demo:
- https://ricketyspace.net/tmp/sign-csr-acmev2-demo.mkv
- https://ricketyspace.net/tmp/revoke-crt-acmev2-demo.mkv

Summary of changes:

  • Require Python 3
  • Use ACMEv2
  • Require user account private key.
    • ACME v2 requires all requests to be signed by the user's
      Let's Encrypt account private key. It becomes tedious ask the
      user to manually sign for every request.
    • The private key provided to sign_csr.py and revoke_crt.py may
      be encrypted. openssl directly asks the user for the passphrase
      if it's encrypted (This is illustrated in the demo videos).
  • file_based option is the default.
    • sign_csr.py no longer provides the simple HTTP server
      to serve the challenge files.
    • The user will have to manually provision the challenge
      files on the domain server.

Addresses issue #100.

r5d added 18 commits June 3, 2019 20:51
Import only Python 3 modules.
Set `universal_newlines` argument to True for `subprocess.Popen` calls
that require the `stdout_data` from `proc.communicate()` to be of type
`str`.
- Convert `b` to `bytes` if it is a `str`.
- Convert the base64 encoded `bytes` to `str` before using `replace`
  for stripping `=`.
Files opened using `tempfile.NamedTemporaryFile` are opened by default
in binary mode. Writing `str` to the temporary file causes it error
out.
Update error handling sections to treat the result of `HTTPError.read`
as `bytes`.
Decode `signed_der64` to `str` before passing it to `textwrap.wrap`.
Encode accountkey_json (to bytes) before passing to hashlib.sha256.
- Import urllib.request
- Remove python2 urllib2 import.
Set `universal_newlines` argument to True for the `subprocess.Popen`
that reads the public key so that the `out` returned from
proc.communicate is of type `str`.
Files opened using `tempfile.NamedTemporaryFile` are opened by default
in binary mode. Writing `str` to the temporary file causes it error
out.
- Convert `b` to `bytes` if it is a `str`.
- Convert the base64 encoded `bytes` to `str` before using `replace`
  for stripping `=`.
@r5d r5d requested a review from diafygi February 2, 2020 16:54
@r5d r5d changed the title WIP: Use ACME version 2 Use ACME version 2 Feb 9, 2020
@r5d
Copy link
Author

r5d commented Feb 9, 2020

@diafygi, would you be interested in merging this?

@vaindil
Copy link

vaindil commented Mar 9, 2020

This is awesome, thank you! I'll use your fork since it seems this repo is no longer being updated.

@r5d
Copy link
Author

r5d commented Apr 25, 2020

I'll be maintaining a fork of acme-nosudo at https://github.com/r5d/acmens

@r5d r5d closed this Apr 17, 2021
@r5d r5d deleted the acmev2 branch April 17, 2021 02:19
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