Commit graph

502 commits

Author SHA1 Message Date
Jacob Hoffman-Andrews
b3004fe6cf Handle critical SAN extension. (#4931)
* Handle critical SAN extension.

* Add testdata/critical-san.pem.
2017-07-18 15:57:00 -07:00
yomna
bc3765d6d0 No longer mask failed challenge errors with encoding errors (#4867)
*     no longer masker failed challenge errors with encoding errors

* simplifying through type-checking

* bytes
2017-07-10 21:05:52 -05:00
ohemorange
57e56cc97b Candidate 0.16.0 (#4908)
* Release 0.16.0

* Bump version to 0.17.0
2017-07-06 15:57:11 -07:00
Brad Warren
5318945267 Hide exceptions that occur during session.close() (#4891)
* Hide exceptions that occur during session.close()

This fixes #4840. Exceptions that are raised out of __del__ methods are caught
and printed to stderr. By catching any exceptions that occur, we now prevent
this from happening.

Alternative solutions to this would have been either not calling
session.close() at all or adding a close() method to acme.client.ClientNetwork,
acme.client.Client, and certbot.client.Client and using certbot.client.Client
in a context manager to ensure close() is called. The former means that users
of the ACME library never properly close their connections until their program
exits and the latter adds a lot of complexity and nesting of client code for
little benefit.

* Only catch Exceptions
2017-07-05 09:25:44 -04:00
Brad Warren
f4094e4d3f Finish oldest tests (#4857)
* Pin oldest version of packaged python deps

* Install security extras in oldest tests

* Revert "bump requests requirement to >=2.10 (#4248)"

This reverts commit 402ad8b353.

* Use create=True when patching open on module
2017-06-23 09:40:59 -07:00
Brad Warren
0aab244846 Bump version to 0.16.0 2017-06-08 09:32:57 -07:00
Brad Warren
74acd1ee5a
Release 0.15.0 2017-06-08 09:32:41 -07:00
ohemorange
239184882e Enable IPv6 support in standalone plugin (#4773)
* add TLSSNI01DualNetworkedServers

* use DualNetworkedServers in certbot/plugins/standalone.py
  also, make both servers run on the same port.

* make probe_sni connect on ipv6 and ipv4 using None

* mimic BSD-like conditions to get test coverage

* test ServerManager taking into account BSD systems

* pass tests even if python is compiled without ipv6 support
2017-06-06 17:04:45 -07:00
Schuyler Duveen
7531c98916 fixes #3616: make sure there is always one time that we test the sock… (#4712) 2017-06-06 10:11:33 -07:00
Jacob Hoffman-Andrews
10bac107ee Add an account deactivate utility script. (#4254)
* Add an account deactivate utility script.

This is handy if you created an account with a tool other than Certbot, and want
to deactivate the account.

* Move deactivate.py to tools.

* Add test for ConflictError.

* Fix lint error.

* Document how to set server.
2017-05-17 14:24:59 -07:00
Jacob Hoffman-Andrews
686f5d6c81 Move 'jwk' and 'alg' fields to protected header. (#4677)
* Move 'jwk' and 'alg' fields to protected header.

Previously, these were in the unprotected JWS header, which Boulder currently
allows. However, the next version of the spec doesn't allow anything in the
unprotected header. Moving these fields now allows server implementers who are
implementing the Certbot/Boulder version of ACME
(https://github.com/letsencrypt/boulder/blob/master/docs/acme-divergences.md) to
use JOSE libraries that don't support unprotected headers.

Fixes #4417.

* Only protect existing headers.
2017-05-17 13:46:52 -07:00
Brad Warren
2754a2d0ae Bump version to 0.15.0 2017-05-04 16:52:29 -07:00
Brad Warren
4be7efbf74
Release 0.14.0 2017-05-04 16:52:13 -07:00
Brad Warren
5ca8f7c5b9 Add lockfile (#4449)
* add lock_file

* cleanup lock file

* Add LockFile tests

* add lock_dir

* add lock_dir_until_exit

* add set_up_core_dir and move lock_dir_until_exit

* Move lock_and_call to certbot.test.util

* Add lock to Apache

* Add lock to the Nginx plugin

* Improve permissions error message

* sort plugins

* add test_prepare_order

* provide more actionable permissions error

* Document and catch use of OSError

* don't lock a directory twice

* add conditional dependency on ordereddict

* Add lock_test

* expand sorted plugins comment

* Add lock_test to lint

* make make_lineage more conventional and flexible

* enhance lock_test.py

* add lock_test to tox

* Readd success message

* make py26 happy

* add test_acquire_without_deletion
2017-05-01 14:49:12 -07:00
Brad Warren
8fa12bef8e Tell the world we're Python 3 compatible (#4568)
* Mention python 3 support in setup.py

* Build universal (py2 and py3 compatible) wheels

* Mention Python 3.3+ support in docs

* we work on python 3.6 too
2017-04-28 16:06:45 -07:00
Brad Warren
89af460792 Reuse dynamic install_requires. (#4554)
* Revert "Make argparse dependency unconditional. (#2249)"

  This reverts commit 8f10103496.

* Update comment about environment markers
2017-04-28 15:03:50 -07:00
Jacob Hoffman-Andrews
b3116af5b4 Add url and kid to jws. (#4340)
* Add url and kid to jws.

This will be required in order to implement the latest ACME spec, which uses
these protected header fields.

* Add comments and fix lint.

* Enforce mutual exclusivity of jwk and kid.
2017-04-21 18:49:57 -07:00
Jacob Hoffman-Andrews
d557c39c99 Remove obsolete fields from Registration. (#4339)
Authorizations and certificates were in the original spec but have since been
deleted.
2017-04-07 09:52:12 -07:00
Ngo The Trung
315b6d0cf1 Fix unorderable types error (#4409)
If the updated datetime collides, the comparator of heapq will move
onto the AuthorizationResource value and throws an "unorderable type"
error.

This adds an index value to the element tuple to ensure that they are
always strictly ordered.
2017-04-07 09:46:27 -07:00
Jacob Hoffman-Andrews
cacee80c51 Move make_csr into acme.crypto_util (#4165)
It's relatively finicky to make a CSR appropriate to pass to poll_and_request_issuance. I think most users want to be able to give a list of domains and a private key, and get back a CSR. This branch adds that functionality to crypto_util.

Note that the two new functions take arguments, and return values, as PEM-encoded buffers. This is a departure from some existing ACME interfaces that take PyOpenSSL types. I've discussed with the Certbot team, and we agree that this is broadly the direction the ACME API should take, so that users of the module don't need to import PyOpenSSL themselves, or use its primitives.

* Add make_csr.

* accept privkey

* Tweak API.

* Remove make_csr from certbot package.

* Skip test in older Pythons.

* Move get_Extensions call under protection.

* Remove assertIn because not backwards-compatible.

* Fix encoding, and use PEM.

* Fix test

* Fix tests on py35.

* Fix error in test.

* Make import_csr_file always return PEM.

Also delete get_sans_from_csr (unused) and get_names_from_csr (newly unused).

* Fix function doc.

* Fix indent

* Fix call of obtain_certificate_from_Csr

* lint

* Handle review feedback.

* Fix test.
2017-04-07 09:43:33 -07:00
Erica Portnoy
82f3f7523e Candidate 0.13.0 (#4475)
* Release 0.13.0

* Bump version to 0.14.0
2017-04-06 11:33:32 -07:00
Damien Tournoud
5c93ceb675 acme: Make the network timeout configurable (#4237)
This follows up on https://github.com/certbot/certbot/pull/4217, but allows users to override the default setting.
2017-03-27 09:24:05 -07:00
dokazaki
8011fb2879 Add mypy (#4386)
* Initial configuration of mypy in box, correction of base mypy errors.

* Move mypy install to toe

* Add pylint comments for typing imports.

* Remove typing module for Python 2.6 compatibility.
2017-03-18 19:10:10 -07:00
Jacob Hoffman-Andrews
018a304cd6 Remove Link rel=next for authzs and new-certs. (#4303)
An early version of the spec indicated that clients should process issuance
sequentially, following Link rel=next from an account URL to an authz URL, to a
new-cert URL. However, the spec has long since moved to putting these URLs in
the directory.

Certbot nominally supports either; This change consolidates on always using the
directory, simplifying things and making the transition to the latest ACME spec
easier.

* Revert "Revert "Remove Link rel=next for authzs and new-certs." (#4277)"

This reverts commit 11ec1eb911.

* Save new_authzr_uri with account for older clients.

* Add test that new_authzr_uri exists in regr.

* Restore backwards compatibility for new_authzr_uri.

* Fix account_test.

* Add test for deprecated URI argument to request_challenges.

* Review feedback.

* Fix test

* Add omitempty to new_cert_uri.
2017-03-14 21:44:57 -07:00
Brad Warren
662c323b55 Build wheels correctly for Python 2.6 (#4313)
* stop conditionally pinning mock version in acme

* stop conditionally pinning mock version in certbot

* stop conditionally pinning mock version in apache

* stop conditionally pinning mock version in nginx

* stop conditionally pinning mock version in letshelp

* stop conditionally pinning mock version in compatibility-test
2017-03-10 10:58:03 -08:00
Erik Rose
8f10103496 Make argparse dependency unconditional. (#2249)
The primary motivation is to avoid a branch, giving bugs one fewer place to hide. But, as a bonus, more people get a more bugfixed version of argparse. (To use the example from the argparse docs, people stuck on Python 3.2.3 can get bugfixes that made it into the stdlib only in 3.2.4.)
2017-03-08 17:10:12 -08:00
Blake Griffith
12a6e49cf1 Remove use of sha1 (#4271)
These are not security critical uses of sha1 but they should still be removed.
2017-03-02 21:16:19 -08:00
Jacob Hoffman-Andrews
53117b0ce0 Remove UnexpectedUpdate exceptions. (#4197)
* Remove UnexpectedUpdate exceptions.

These exceptions trigger when the server sends the client back an object with a
field that doesn't exactly match what the client previously sent.

This causes unnecessary breakage in various cases, doesn't prevent any problems,
and isn't required by spec.

* Back out all UnexpectedUpdate removals except registration update.
2017-03-02 17:27:29 -08:00
Erica Portnoy
5e671682ca Candidate 0.12.0 (#4286)
* Release 0.12.0

* Bump version to 0.13.0
2017-03-02 15:26:24 -08:00
Brad Warren
11ec1eb911 Revert "Remove Link rel=next for authzs and new-certs." (#4277) 2017-03-02 10:31:15 -08:00
Damien Tournoud
44a6ec29c5 Fix direct usages of the root logger (#4236)
Some code uses `logging.debug` and `logging.info` instead of
the file-specific logger in `logger.debug` and `logger.info`.
2017-02-27 18:13:06 -08:00
Brad Warren
402ad8b353 bump requests requirement to >=2.10 (#4248) 2017-02-27 17:17:08 -08:00
Jacob Hoffman-Andrews
a92ca8e97c Add default timeout to ClientNetwork. (#4217)
In https://community.letsencrypt.org/t/letsencrypt-cli-hangs-on-certificate-request/27211,
a community member pointed out that Certbot seems to hang when there are
routing problems.
2017-02-22 18:48:01 -08:00
Jacob Hoffman-Andrews
1380e59f56 Remove Link rel=next for authzs and new-certs. (#4194)
An early version of the spec indicated that clients should process issuance
sequentially, following Link rel=next from an account URL to an authz URL, to a
new-cert URL. However, the spec has long since moved to putting these URLs in
the directory.

Certbot nominally supports either; This change consolidates on always using the
directory, simplifying things and making the transition to the latest ACME spec
easier.
2017-02-13 19:50:33 -08:00
Brad Warren
a6b51f1edd Bump version to 0.12.0 2017-02-01 09:50:57 -08:00
Brad Warren
30bc68ccde
Release 0.11.0 2017-02-01 09:50:42 -08:00
Brad Warren
be5bcfe463 Remove optional dependencies (#4088)
* Stop using already_listening in standalone

* remove already_listening

* remove psutil entirely

* fix #595

* Add basic perform test

* make pep8 happy

* Add test_perform_eacces

* add _setup_perform_error

* Add test_perform_unexpected_socket_error

* add test_perform_eaddrinuse_no_retry

* add test_perform_eaddrinuse_retry

* cleanup tests

* stop using dnspython

* don't install dns extras in tox

* remove dns extras from setup.py

* Add simple_verify back to DNS response

* remove dnspython from oldest tests
2017-01-30 16:55:54 -08:00
Brad Warren
240438eec7 Incorporate feedback from 4113 (#4115) 2017-01-30 09:44:55 -08:00
Josh Soref
6a39a42f45 Spelling (#4101)
* spelling: action

* spelling: artifacts

* spelling: asymmetric

* spelling: attempts

* spelling: bizarre

* spelling: certbot

* spelling: certificate

* spelling: certainly

* spelling: challenge

* spelling: client

* spelling: collated

* spelling: correct

* spelling: considered

* spelling: custom

* spelling: distinguish

* spelling: encoding

* spelling: enhancement

* spelling: equivalent

* spelling: execution

* spelling: existence

* spelling: failed

* spelling: handshake

* spelling: hyphen

* spelling: initialized

* spelling: initialization

* spelling: interpretation

* spelling: letsencrypt

* spelling: multiline

* spelling: multipart

* spelling: necessary

* spelling: otherwise

* spelling: output

* spelling: overridden

* spelling: positives

* spelling: preferable

* spelling: progress

* spelling: recommended

* spelling: referring

* spelling: relativity

* spelling: request

* spelling: requiring

* spelling: separate

* spelling: source

* spelling: specified

* spelling: standard

* spelling: successfully

* spelling: unparseable

* spelling: useful
2017-01-26 16:21:54 -08:00
Brad Warren
c650c9a709 add test_post_successful_retry 2017-01-25 15:10:24 -08:00
Brad Warren
46d9809fa1 add test_post_failed_retry 2017-01-25 15:08:01 -08:00
Brad Warren
a5da551965 fix stylistic nits with POST retry 2017-01-25 14:10:19 -08:00
Frederic BLANC
b6fecca7ba fixes #2244 2017-01-25 13:38:00 -08:00
Brad Warren
bb669528b3 Remove old references to pep8 in our code (#4073) 2017-01-19 11:21:25 -08:00
Blake Griffith
49d46ef99a Impelment account deactivation [revision requested] (#3571)
Impelment account deactivation
2017-01-17 16:00:07 -08:00
Peter Eckersley
796220f6f1 Adopt consistent linting practices for the entire tree (#3843)
* Use the certbot pylintrc for the ACME module

* Further parallelise lint, and don't run PEP8 checks
2017-01-17 12:53:13 -08:00
Craig Smith
94c23479e2 Add option to specify revocation reason (#3242) (#3988)
This includes two new tests in the integration test script to check that
boulder gets the correct code. The encoding is specified in RFC5280
5.3.1. The codes that boulder will accept are a subset of that,
specified in `boulder.revocation.reasons.go`.
2017-01-11 18:26:55 -08:00
Brad Warren
364a6d8a2d Release 0.10.0 (#4022)
* Release 0.10.0

* Bump version to 0.11.0
2017-01-11 12:01:33 -08:00
Ondřej Surý
379807bf0d Add workaround for platforms where injecting pyopenssl to urllib3 (#3990)
fails with requests package (Ubuntu Trusty)
2017-01-10 11:39:40 -08:00
Peter Eckersley
59c602d9ca Parallalelise nosetests from tox (#3836)
* Parallalelise nosetests from tox

* Parallelise even more things, break even more things

* Now unbreak all the tests that aren't ready for ||ism

* Try to pass tests!

 - Remove non-working hack in reporter_test
 - also be selective about ||ism in the cover environment

* Try again

* certbot-apache tests also work, given enough time

* Nginx may need more time in Travis's cloud

* Unbreak reporter_test under ||ism

* More timeout

* Working again?

* This goes way faster

* Another big win

* Split a couple more large test suites

* A last improvement

* More ||ism!

* ||ise lint too

* Allow nosetests to figure out how many cores to use

* simplify merge

* Mark the new CLI tests as ||izable

* Simplify reporter_test changes

* Rationalise ||ism flags

* Re-up coverage

* Clean up reporter tests

* Stop modifying testdata during tests

* remove unused os
2016-12-06 20:39:16 -08:00