Commit graph

927 commits

Author SHA1 Message Date
Adrien Ferrand
0b5468e992 Implement POST-as-GET requests (#6522)
* Setup an integration tests env against Pebble, that enforce post-as-get

* Implement POST-as-GET requests, with fallback to GET.

* Fix unit tests

* Fix coverage.

* Fix or ignore lint errors

* Corrections after review

* Correct test

* Try a simple delegate approach

* Add a test

* Simplify test mocking

* Clean comment
2018-11-29 19:42:06 -05:00
Erica Portnoy
1c23fea076 ignore erroneously no-member lint error 2018-11-27 17:24:34 -08:00
Erica Portnoy
3edb36c4cc Revert acme/acme/client.py 2018-11-22 03:43:25 +00:00
Erica Portnoy
5700af594b Merge branch 'master' into warnings-are-errors 2018-11-17 02:29:20 +00:00
Brad Warren
22858c6025 Bump version to 0.29.0 2018-11-07 13:22:59 -08:00
Brad Warren
c1300a8e1b
Release 0.28.0 2018-11-07 13:22:57 -08:00
Erica Portnoy
c3fa05ba74 remove unused six imports 2018-11-05 17:38:29 -08:00
Erica Portnoy
b7f4b33ffb Remove module-level ignore::ResourceWarnings 2018-11-05 17:28:26 -08:00
Erica Portnoy
0e98904bec Merge branch 'master' into warnings-are-errors 2018-11-05 16:57:50 -08:00
ohemorange
cb8dd8a428
Warn when using deprecated acme.challenges.TLSSNI01 (#6469)
* Warn when using deprecated acme.challenges.TLSSNI01

* Update changelog

* remove specific date from warning

* add a raw assert for mypy optional type checking
2018-11-05 14:50:20 -08:00
ohemorange
2c1964c639
Use the ACMEv2 newNonce endpoint when a new nonce is needed (#6442)
Also, add checking to the newNonce HEAD request, and check responses in general before attempting to save a nonce, for a better error message.

* check response before adding nonce to the pool

* fix tests so that they test what they're supposed to test, and also allow the order of _add_nonce and _check_response to be switched

* make _get_nonce take acme_version

* Send HEAD to newNonce endpoint when using ACMEv2

* check the HEAD newNonce response

* remove unnecessary try; get returns None if the item doesn't exist

* instead of setting new_nonce_url on ClientNetwork, use the saved directory in ClientBase and pass that into ClientNetwork.post

* no need to test acme_version in _get_nonce

* pop new_nonce_url out of kwargs before passing to _send_request
2018-11-02 17:32:33 -07:00
Erica Portnoy
0caaf872fb bring requests back down to 2.4.1 in setup and oldest constraints 2018-11-02 15:53:44 -07:00
Erica Portnoy
1b595f26d8 Requests no longer vendorizes urllib3 2018-11-02 13:31:48 -07:00
Erica Portnoy
e37a8fbded Use a newer version of requests because of the upcoming Callable import Deprecation in Python 3.8 that warns in Python 3.7 2018-11-02 13:01:14 -07:00
Erica Portnoy
d02ea812a5 Cover is run on 2.7, so mark 3-only lines as no cover 2018-11-02 12:36:42 -07:00
Erica Portnoy
36b6328acd Ignore ResourceWarnings in various modules in a 2-compatible way.
Sometimes tests are flaky about giving this warning, particularly in ACME. I recommend just ignoring them.
2018-11-01 17:56:01 -07:00
Erica Portnoy
6e7d42f298 ignore ResourceWarnings in acme tests 2018-11-01 17:17:19 -07:00
Erica Portnoy
54b4758c27 Merge branch 'master' into warnings-are-errors 2018-10-30 17:18:00 -07:00
Adrien Ferrand
1e8c13ebf9 [Windows] Create the CI logic (#6374)
So here we are: after #6361 has been merged, time is to provide an environment to execute the automated testing on Windows.

Here are the assertions used to build the CI on Windows:

every test running on Linux should ultimately be runnable on Windows, in a cross-platform compatible manner (there is one or two exception, when a test does not have any meaning for Windows),
currently some tests are not runnable on Windows: theses tests are ignored by default when the environment is Windows using a custom decorator: @broken_on_windows,
test environment should have functionalities similar to Travis, in particular an execution test matrix against various versions of Python and Windows,
so test execution is done through AppVeyor, as it supports the requirements: it add a CI step along Travis and Codecov for each PR, all of this ensuring that Certbot is entirely functional on both Linux and Windows,
code in tests can be changed, but code in Certbot should be changed as little as possible, to avoid regression risks.
So far in this PR, I focused on the tests on Certbot core and ACME library. Concerning the plugins, it will be done later, for plugins which have an interest on Windows. Test are executed against Python 3.4, 3.5, 3.6 and 3.7, for Windows Server 2012 R2 and Windows Server 2016.

I succeeded at making 258/259 of acme tests to work, and 828/868 of certbot core tests to work. Most of the errors where not because of Certbot itself, but because of how the tests are written. After redesigning some test utilitaries, and things like file path handling, or CRLF/LF, a lot of the errors vanished.

I needed also to ignore a lot of IO errors typically occurring when a tearDown test process tries to delete a file before it has been closed: this kind of behavior is acceptable for Linux, but not for Windows. As a consequence, and until the tearDown process is improved, a lot of temporary files are not cleared on Windows after a test campaign.

Remaining broken tests requires a more subtile approach to solve the errors, I will correct them progressively in future PR.

Last words about tox. I did not used the existing tox.ini for now. It is just to far from what is supported on Windows: lot of bash scripts that should be rewritten completely, and that contain test logic not ready/relevant for Windows (plugin tests, Docker compilation/test, GNU distribution versatility handling and so on). So I use an independent file tox-win.ini for now, with the goal to merge it ultimately with the existing logic.

* Define a tox configuration for windows, to execute tests against Python 3.4, 3.5, 3.6 and 3.7 + code coverage on Codecov.io

* Correct windows compatibility on certbot codebase

* Correct windows compatibility on certbot display functionalities

* Correct windows compatibility on certbot plugins

* Correct test utils to run tests on windows. Add decorator to skip (permanently) or mark broken (temporarily) tests on windows

* Correct tests on certbot core to run them both on windows and linux. Mark some of them as broken on windows for now.

* Lock tests are completely skipped on windows. Planned to be replace in next PR.

* Correct tests on certbot display to run them both on windows and linux. Mark some of them as broken on windows for now.

* Correct test utils for acme on windows. Add decorator to skip (permanently) or mark broken (temporarily) tests on windows.

* Correct acme tests to run them both on windows and linux. Allow a reduction of code coverage of 1% on acme code base.

* Create AppVeyor CI for Certbot on Windows, to run the test matrix (py34,35,36,37+coverage) on Windows Server 2012 R2 and Windows Server 2016.

* Update changelog with Windows compatibility of Certbot.

* Corrections about tox, pyreadline and CI logic

* Correct english

* Some corrections for acme

* Newlines corrections

* Remove changelog

* Use os.devnull instead of /dev/null to be used on Windows

* Uid is a always a number now.

* Correct linting

* PR https://github.com/python/typeshed/pull/2136 has been merge to third-party upstream 6 months ago, so code patch can be removed.

* And so acme coverage should be 100% again.

* More compatible tests Windows+Linux

* Use stable line separator

* Remove unused import

* Do not rely on pytest in certbot tests

* Use json.dumps to another json embedding weird characters

* Change comment

* Add import

* Test rolling builds #1

* Test rolling builds #2

* Correction on json serialization

* It seems that rolling builds are not canceling jobs on PR. Revert back to fail fast code in the pipeline.
2018-10-19 14:53:15 -07:00
Erica Portnoy
6500b9095e Add test to confirm that status isn't set on neworder object 2018-10-18 10:37:56 -07:00
Erica Portnoy
ee02ed65af remove default status from Order so that the status field isn't filled in upon boulder deserialization 2018-10-18 10:26:37 -07:00
Erica Portnoy
a3a3840e91 replace status field 2018-10-18 10:19:57 -07:00
Erica Portnoy
ca155b48ae Merge branch 'master' into prune_neworder 2018-10-18 10:16:59 -07:00
Erica Portnoy
e28f3da974 Bump version to 0.28.0 2018-09-05 15:42:01 -07:00
Erica Portnoy
19149a0d57
Release 0.27.0 2018-09-05 15:41:59 -07:00
Joona Hoikkala
8943dffe0d
Removed status and resource fields from NewOrder object 2018-08-01 12:17:23 +03:00
Joona Hoikkala
b1b4650804
Revert "Do not send status or resource fields in newOrder payloads for ACMEv2"
This reverts commit d19698251d.
2018-08-01 12:10:55 +03:00
Joona Hoikkala
c131f4211d
Revert "Fix tests"
This reverts commit 8b3629ebd4.
2018-08-01 12:10:01 +03:00
Joona Hoikkala
8b3629ebd4
Fix tests 2018-07-31 19:55:19 +03:00
Joona Hoikkala
d19698251d
Do not send status or resource fields in newOrder payloads for ACMEv2 2018-07-31 17:08:39 +03:00
dovreshef
dc91357418 Raise ConflictError on attempts to create an existing account (#6251)
* Raise ConflictError on attempts to create an existing account in ACME V2.

Fixes issue #6246

* Allow querying an account without calling new_account in ACMEv2

Fixed issue #6258
2018-07-27 08:50:53 -07:00
Brad Warren
fdb3c8df4b s/assertEquals/assertEqual 2018-07-11 17:33:04 -07:00
Brad Warren
0a6d520d26 Bump version to 0.27.0 2018-07-11 14:18:44 -07:00
Brad Warren
95e271bfcd
Release 0.26.0 2018-07-11 14:18:26 -07:00
Jacob Hoffman-Andrews
0672e63176 Remove main components from Alpha. (#6187)
acme, certbot, and the Nginx and Apache plugins should no longer be considered alpha-quality.
2018-07-10 13:52:58 -07:00
ohemorange
83f7e72fef Update and delete registration with account reuse (#6174)
* find the correct url when deactivating an acmev1 account on the acmev2 endpoint

* set regr in ClientNetwork.account after deactivating on the server

* update self.net.account

* move logic into update_registration

* return methods to their original order to please git

* factor out common code

* update test_fowarding to use a method that still gets forwarded

* add acme module test coverage

* pragma no cover on correct line

* use previous regr uri

* strip unnecessary items from regr before saving

* add explanation to main.py

* add extra check to client_test.py

* use empty dict instead of empty string to indicate lack of body that we save to disk
2018-07-10 13:03:25 -07:00
Brad Warren
43f2bfd6f1
Advertise our packages work on Python 3.7. (#6183) 2018-07-09 09:17:03 -07:00
Brad Warren
552e60a126 Don't use hardcoded port in tests (#6145)
* Don't use port 1234 in standalone tests.

* rename unused variable

* add back failure case

* Add back probe connection error test.

* fix lint

* remove unused import

* fix test file coverage

* prevent future heisenbug
2018-06-29 15:27:58 +03:00
Brad Warren
a4760cfe56
Partially revert "Implement TLS-ALPN-01 challenge and standalone TLS-ALPN server (#5894)" (#6144)
This partially reverts commit 15f1405fff.

A basic tls-alpn-01 implementation is left so we can successfully parse the
challenge so it can be used in boulder's tests.
2018-06-26 15:33:41 -07:00
Brad Warren
9f20fa0ef9 Fixes #6085. (#6091)
The value of norecusedirs is the default in newer versions of pytest which is
listed at
https://docs.pytest.org/en/3.0.0/customize.html#confval-norecursedirs.
2018-06-12 17:31:22 -07:00
Roland Bracewell Shoemaker
da028ca9c2 Wrap TLS-ALPN extension with ASN.1 (#6089)
* Wrap TLS-ALPN extension with ASN.1

* Fix test
2018-06-11 11:59:57 -07:00
Brad Warren
4b11fe1fda Bump version to 0.26.0 2018-06-06 13:50:46 -07:00
Brad Warren
4ae2390c44
Release 0.25.0 2018-06-06 13:50:30 -07:00
Brad Warren
868e5b831b
Make python setup.py test use pytest for acme (#6072) 2018-06-05 17:59:11 -07:00
Brad Warren
236f9630e0
Remove unneeded sys import (#5873)
* Remove unneeded sys import.

Once upon a time we needed this in some of these setup.py files because we were
using sys in the file, but we aren't anymore so let's remove the import.

* use setuptools instead of distutils
2018-06-04 15:04:56 -07:00
Maciej Dębski
15f1405fff Implement TLS-ALPN-01 challenge and standalone TLS-ALPN server (#5894)
The new challenge is described in https://github.com/rolandshoemaker/acme-tls-alpn.

* TLS-ALPN tests

* Implement TLS-ALPN challenge

* Skip TLS-ALPN tests on old pyopenssl

* make _selection methods private.
2018-06-04 14:54:17 -07:00
Kevin Le
deb5b072d9 Log cases when standalone fails to bind a port. (#5985)
* Log cases when standalone fails to bind a port.

* Fix linter + changed log message

* Changed multiline string format

* Fixed indentation in standalone.py
2018-05-23 19:59:49 +03:00
Quang Vu
cfd4b8f363 #4242 Support multi emails register (#5994)
This change will allow registering/updating account with multi emails.
Detail is enclosed in #4242

* support multi emails register

* add more test cases

* update test to unregister before register

* update create path to support multi emaill

* refactor payload updating

* fix typo

* move command line doc to another place

* revert the change for updating account registration info, added unit test

* rearrange text for consistency
2018-05-22 15:32:44 -07:00
Dmitry Figol
36dfd06503 Prepare certbot module for mypy check untyped defs (#6005)
* Prepare certbot module for mypy check untyped defs

* Fix #5952

* Bump mypy to version 0.600 and fix associated bugs

* Fix pylint bugs after introducing mypy

* Implement Brad's suggestions

* Reenabling pylint and adding nginx mypy back
2018-05-18 06:28:17 -07:00
James Payne
5300d7d71f Fix Pylint upgrade issues
* Remove unsupported pylint disable options
    * star-args removed in Pylint 1.4.3
    * abstract-class-little-used removed in Pylint 1.4.3

* Fixes new lint errors

* Copy dummy-variable-rgx expression to new ignored-argument-names expression to ignore unused funtion arguments

* Notable changes
    * Refactor to satisfy Pylint no-else-return warning
    * Fix Pylint inconsistent-return-statements warning
    * Refactor to satisfy consider-iterating-dictionary
    * Remove methods with only super call to satisfy useless-super-delegation
    * Refactor too-many-nested-statements where possible
    * Suppress type checked errors where member is dynamically added (notably derived from josepy.JSONObjectWithFields)
    * Remove None default of func parameter for ExitHandler and ErrorHandler

Resolves #5973
2018-05-16 20:37:39 +00:00
Douglas Anger
99d94cc7e8 Make request logs pretty in Python 3 (#5992)
Decode response data as UTF-8 to eliminate ugly bytes repr in Python 3.

Resolves #5932
2018-05-14 14:45:25 -07:00
signop
02b128a128 Add support for specifying source_address to ClientNetwork. (#5990)
For certbot/certbot#3489
2018-05-14 14:43:43 -07:00
ohemorange
5940ee92ab
add ready status type (#5941) 2018-05-11 14:25:02 -07:00
ohemorange
3eaf35f1e2 Check_untyped_defs in mypy with clean output for acme (#5874)
* check_untyped_defs in mypy with clean output for acme

* test entire acme module

* Add typing as a dependency because it's only in the stdlib for 3.5+

* Add str_utils, modified for python2.7 compatibility

* make mypy happy in acme

* typing is needed in prod

* we actually only need typing in acme so far

* add tests and more docs for str_utils

* pragma no cover

* add magic_typing

* s/from typing/from magic_typing/g

* move typing to dev_extras

* correctly set up imports

* remove str_utils

* only type: ignore for OpenSSL.SSL, not crypto

* Since we only run mypy with python3 anyway and we're fine importing it when it's not actually there, there's no actual need for typing to be present as a dependency

* comment magic_typing.py

* disable wildcard-import im magic_typing

* disable pylint errors

* add magic_typing_test

* make magic_typing tests work alongside other tests

* make sure temp_typing is set

* add typing as a dev dependency for python3.4

* run mypy with python3.4 on travis to get a little more testing with different environments

* don't stick typing into sys.modules

* reorder imports
2018-05-03 13:10:33 -07:00
Brad Warren
32e85e9a23 correct metaclass usage everywhere (#5919) 2018-05-03 10:59:25 +03:00
Brad Warren
0ec0d79c35 Bump version to 0.25.0 2018-05-01 16:59:48 -07:00
Brad Warren
4b870ef940
Release 0.24.0 2018-05-01 16:59:32 -07:00
Brad Warren
0153c04af3
Merge pull request #5829 from certbot/candidate-0.23.0
Update certbot-auto and versions to reflect 0.23.0 release
2018-04-09 12:45:15 -07:00
Peter Linss
db938dcc0e Update messages.py (#5759)
Add wildcard field to AuthorizationResource
2018-04-05 13:39:35 -07:00
Brad Warren
0e30621355 Bump version to 0.24.0 2018-04-04 15:05:08 -07:00
Brad Warren
16b2539f72
Release 0.23.0 2018-04-04 15:04:43 -07:00
Brad Warren
ba6bdb5099
Fix acme.client.Client.__init__ (#5747)
* fixes #5738

* add test to prevent regressions
2018-03-16 17:45:46 -07:00
Brad Warren
53c6b9a08f
Merge pull request #5682 from certbot/candidate-0.22.0
Release 0.22.0
2018-03-12 13:06:30 -07:00
sydneyli
f4bac423fb fix(acme): client._revoke sends default content_type (#5687) 2018-03-07 15:09:47 -08:00
Brad Warren
7a495f2656 Bump version to 0.23.0 2018-03-07 10:26:08 -08:00
Brad Warren
77fdb4d7d6
Release 0.22.0 2018-03-07 10:25:42 -08:00
Brad Warren
e1878593d5
Ensure fullchain_pem in the order is unicode/str (#5654)
* Decode fullchain_pem in ACMEv1

* Convert back to bytes in Certbot

* document bytes are returned
2018-03-05 07:27:44 -08:00
Brad Warren
8121acf2c1
Add user friendly wildcard error for ACMEv1 (#5636)
* add WildcardUnsupportedError

* Add friendly unsupported wildcard error msg

* correct documentation

* add version specifier
2018-03-01 14:54:48 -08:00
Brad Warren
6f86267a26 Fix revocation in ACMEv2 (#5626)
* Allow revoke to pass in a url

* Add revocation support to ACMEv2.

* Provide regr for account based revocation.

* Add revoke wrapper to BackwardsCompat client
2018-02-27 12:42:13 -08:00
Brad Warren
43ba9cbf33
Merge pull request #5605 from certbot/rm-eol-2.6
Drop Python 2.6 and 3.3 support
2018-02-26 13:34:50 -08:00
Nick Bebout
f3a0deba84 Remove min version of setuptools (#5617) 2018-02-23 13:26:11 -08:00
Brad Warren
1e46d26ac3 Fix ACMEv2 issues (#5612)
* Add post wrapper to automatically add acme_version

* Add uri to authzr.

* Only add kid when account is set.

* Add content_type when downloading certificate.

* Only save new_authz URL when it exists.

* Handle combinations in ACMEv1 and ACMEv2.

* Add tests for ACMEv2 "combinations".
2018-02-22 16:28:50 -08:00
ohemorange
457269b005 Add finalize_order to shim object, update Certbot to use it (#5601)
* update order object with returned authorizations

* major structure of finalize_order shim refactor

* util methods and imports for finalize_order shim refactor

* update certbot.tests.client_test.py

* extraneous client_test imports

* remove correct import

* update renewal call

* add test for acme.dump_pyopenssl_chain

* Add test for certbot.crypto_util.cert_and_chain_from_fullchain

* add tests for acme.client and change to fetch chain failure to TimeoutError

* s/rytpe/rtype

* remove ClientV1 passthrough

* dump the wrapped cert

* remove dead code

* remove the correct dead code

* support earlier mock
2018-02-22 10:14:29 -08:00
Brad Warren
f1b7017c0c Finish dropping Python 2.6 and 3.3 support
* Undo letsencrypt-auto changes

* Remove ordereddict import

* Add Python 3.4 tests to replace 3.3

* Add python_requires

* update pipstrap
2018-02-21 19:11:01 -08:00
Erica Portnoy
dea43e90b6 lint 2018-02-20 16:11:36 -08:00
Erica Portnoy
a7eadf8862 add new order test for v1 2018-02-20 16:08:46 -08:00
Erica Portnoy
26bcaff85c add test for new_order for v2 2018-02-20 15:59:58 -08:00
Erica Portnoy
20d0b91c71 switch interface to new_order and remove best_effort flag 2018-02-16 17:35:10 -08:00
Erica Portnoy
ea2022588b add docstring 2018-02-16 16:32:49 -08:00
Erica Portnoy
73bd801f35 add and use request_authorizations 2018-02-16 16:22:26 -08:00
Hugo
42638afc75 Drop support for EOL Python 2.6 and 3.3
* Drop support for EOL Python 2.6

* Use more helpful assertIn/NotIn instead of assertTrue/False

* Drop support for EOL Python 3.3

* Remove redundant Python 3.3 code

* Restore code for RHEL 6 and virtualenv for Py2.7

* Revert pipstrap.py to upstream

* Merge py26_packages and non_py26_packages into all_packages

* Revert changes to *-auto in root

* Update by calling letsencrypt-auto-source/build.py

* Revert permissions for pipstrap.py
2018-02-16 16:14:01 -08:00
ohemorange
e95e963ad6 Get common name from CSR in new_order in ClientV2 (#5587)
* switch new_order to use crypto_util._pyopenssl_cert_or_req_san

* move certbot.crypto_util._get_names_from_loaded_cert_or_req functionality to acme.crypto_util._pyopenssl_cert_or_req_all_names
2018-02-16 16:05:16 -08:00
Brad Warren
70a75ebe9d Add tests and fix minor bugs in Order support
* delint

* refactor client tests

* Add test for new order and fix identifiers parsing.

* Add poll_and_finalize test

* Test and fix poll_authorizations timeout

* Add test_failed_authorizations

* Add test_poll_authorizations_success

* Test and fix finalize_order success

* add test_finalize_order_timeout

* add test_finalize_order_error

* test sleep code
2018-02-15 19:26:01 -08:00
Jacob Hoffman-Andrews
e48898a8c8 ACMEv2: Add Order support
This adds two new classes in messages: Order and OrderResource. It also adds methods to ClientV2 to create orders, and poll orders then request issuance.

The CSR is stored on the OrderResource so it can be carried along and submitted when it's time to finalize the order.
2018-02-15 19:12:15 -08:00
ohemorange
d467a4ae95 Add mechanism to detect acme version (#5554)
Detects acme version by checking for newNonce field in the directory, since it's mandatory. Also updates ClientNetwork.account on register and update_registration.

* add mechanism to detect acme version

* update ClientNetwork.account comment

* switch to MultiVersionClient object in acme

* add shim methods

* add returns

* use backwards-compatible format and implement register

* update to actual representation of tos v2

* add tos fields and pass through to v1 for partial updates

* update tests

* pass more tests

* allow instance variable pass-through and lint

* update certbot and tests to use new_account_and_tos method

* remove --agree-tos test from main_test for now because we moved the callback into acme

* add docstrings

* use hasattr

* all most review comments

* use terms_of_service for both v1 and v2

* add tests for acme/client.py

* tests for acme/messages.py
2018-02-15 19:04:17 -08:00
Eli Young
90664f196f Remove autodocs for long-removed acme.other module (#5529)
This module was removed in 22a9c7e3c2. The
autodocs are therefore unnecessary. Furthermore, they are starting to
cause build failures for Fedora.
2018-02-12 16:43:11 -08:00
ohemorange
d6b247c002 Set ClientNetwork.account after registering (#5558) 2018-02-09 12:54:15 -08:00
Jacob Hoffman-Andrews
9baf75d6c8 client.py changes for ACMEv2 (#5287)
* Implement ACMEv2 signing of POST bodies.

* Add account, and make acme_version explicit.

* Remove separate NewAccount.

* Rename to add v2.

* Add terms_of_service_agreed.

* Split out wrap_in_jws_v2 test.

* Re-add too-many-public-methods.

* Split Client into ClientBase / Client / ClientV2

* Use camelCase for newAccount.

* Make acme_version optional parameter on .post().

This allows us to instantiate a ClientNetwork before knowing the version.

* Add kid unconditionally.
2018-02-06 16:45:33 -08:00
Brad Warren
325a97c1ed Bump version to 0.22.0 2018-01-17 15:55:41 -08:00
Brad Warren
bf695d048d
Release 0.21.0 2018-01-17 15:55:29 -08:00
ohemorange
f5a02714cd Add deprecation warning for Python 2.6 (#5391)
* Add deprecation warning for Python 2.6

* Allow disabling Python 2.6 warning
2018-01-09 16:11:04 -08:00
Jannis Leidel
2abc94661a Use josepy instead of acme.jose. (#5203) 2017-12-11 11:25:09 -08:00
Noah Swartz
0046428382 print warnings for 3.3 users (#5283)
fix errors
2017-12-08 12:45:04 -08:00
Brad Warren
78d97ca023 Bump version to 0.21.0 2017-12-06 14:52:16 -08:00
Brad Warren
f1554324da
Release 0.20.0 2017-12-06 14:46:55 -08:00
Brad Warren
62c1112d10 Keep the same behavior with the uri attribute 2017-12-05 10:26:32 -08:00
Jacob Hoffman-Andrews
8c4f016b2d In ACMEv2, challenges have "url" instead of "uri". To handle this smoothly, Challenge's uri field becomes private (_uri), and is joined by _url. Serialization and deserialization will preserve whichever one was set. The uri name is taken over by an @property that returns whichever of the two is set. I chose not to enforce that they shouldn't both be present because it would just add unnecessary code and brittleness with no stability benefit.
* Make url a virtual field.

* Add @property annotation.
2017-12-04 20:51:19 -08:00
Brad Warren
48173ed1cb
Switch from nose to pytest (#5282)
* Use pipstrap to install a good version of pip

* Use pytest in cb-auto tests

* Remove nose usage in auto_test.py

* remove nose dev dep

* use pytest in test_tests

* Use pytest in tox

* Update dev dependency pinnings

* remove nose multiprocess lines

* Use pytest for coverage

* Use older py and pytest for old python versions

* Add test for Error.__str__

* pin pytest in oldest test

* Fix tests for DNS-DO plugin on py26

* Work around bug for Python 3.3

* Clarify dockerfile comments
2017-12-01 10:59:55 -08:00
Jacob Hoffman-Andrews
a6cecd784b [#4535] - Unwrap 'max retries exceeded' errors (#4733)
Fixes #4535 

Extracts the relevant fields using a regex. We considered catching
specific exception types, and referencing their fields, but the types
raised by `requests` are not well documented and may not be long
term stable. If the regex fails to match, for instance due to a change
in the exception message, the new exception message will just be
passed through.
2017-10-19 14:16:59 -07:00
Brad Warren
13b4a4e1c2 Bump version to 0.20.0 2017-10-04 15:57:16 -07:00
Brad Warren
1f258449a4
Release 0.19.0 2017-10-04 12:11:20 -07:00
Seong-ho Cho
f6be07da74 fix #5111 AttributeError occured with >=pyOpenSSL-17.2.0 (#5112) 2017-09-15 16:57:10 -07:00
Brad Warren
6988491b67 Merge pull request #5080 from certbot/candidate-0.18.0
Release 0.18.0
2017-09-07 05:57:12 -07:00
Brad Warren
a7267b0fcd Bump version to 0.19.0 2017-09-05 16:07:03 -07:00
Brad Warren
756c44f7af
Release 0.18.0 2017-09-05 16:06:43 -07:00
Brad Warren
d710c441e2 Specify the minimum six version in acme 2017-09-05 10:07:32 -07:00
Bob Strecansky
a8e1df6e55 [#4535] - Unwrap max retries exceeded errors 2017-08-07 20:15:05 -04:00
Bob Strecansky
b3216727da [#4535] - Unwrap max retries exceeded errors 2017-08-07 19:34:20 -04:00
Bob Strecansky
8a78ef9675 [#4535] - Unwrap max retries exceeded errors 2017-08-07 15:33:01 -04:00
Bob Strecansky
2e7ec00e8c [#4535] - Unwrap max retries exceeded errors 2017-08-07 08:55:43 -04:00
Bob Strecansky
f7dedae388 [#4535] - Unwrap max retries exceeded errors 2017-08-07 08:39:39 -04:00
Bob Strecansky
9ae987d72b [#4535] - Unwrap max retries exceeded errors 2017-08-07 08:35:00 -04:00
Bob Strecansky
0c14d9372d Merge branch 'master' of github.com:certbot/certbot into max_retries_exceeded 2017-08-07 08:14:54 -04:00
Bob Strecansky
9b8c8f103e [#4535] - Unwrap max retries exceeded errors 2017-08-06 23:44:28 -04:00
Bob Strecansky
8555f4a0bd [#4535] - Unwrap max retries exceeded errors 2017-08-06 23:30:11 -04:00
Bob Strecansky
521f783020 [#4535] - Unwrap max retries exceeded errors 2017-08-06 23:02:07 -04:00
Bob Strecansky
5fb1568b6e [#4535] - Unwrap max retries exceeded errors 2017-08-06 22:26:17 -04:00
Bob Strecansky
57e664077f [#4535] - Unwrap max retries exceeded errors - fixing spacing 2017-08-06 10:51:10 -04:00
Bob Strecansky
880c35f3e3 [#4535] - Unwrap max retries exceeded errors 2017-08-05 10:39:04 -04:00
Bob Strecansky
3cc94798b6 [#4535] - Unwrap max retries exceeded errors 2017-08-05 10:26:01 -04:00
Bob Strecansky
959d72feb0 [#4535] - Unwrap max retries exceeded errors 2017-08-05 10:16:47 -04:00
Bob Strecansky
1e71ff5377 [#4535] - Unwrap max retries exceeded errors 2017-08-02 22:59:27 -04:00
Brad Warren
744c993040 Bump version to 0.18.0 2017-08-01 17:01:19 -07:00
Brad Warren
912d235466
Release 0.17.0 2017-08-01 17:01:07 -07:00
Bob Strecansky
18d3df78e8 [#4535] - Unwrap max retries exceeded errors 2017-07-26 20:37:13 -04:00
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
Peter Eckersley
8b67a58f3c Ensure tests pass with openssl 1.1 (#3827)
* Ensure tests pass with openssl 1.1

A bunch of the acme.standalone and acme.crypto_util tests were using
weak crypto that is now prohibited :/

* lint

* lintlint

* Fix symlink
2016-12-02 15:11:35 -08:00
Brad Warren
edbb3a73c6 Take advantage of urllib3 pyopenssl rewrite (#3805)
* pin requests version in py26-oldest

* Determine requests security deps dynamically

Starting with requests 2.12, pyasn1 and ndg-httpsclient are no longer
needed to inject pyopenssl into urllib3. This change allows us to
determine whether or not these dependencies are required at install
time. If an older version of requests is used, these packages are
still installed. If a new version of requests is used, they are not
reducing the number of dependencies we have.

* Bump requests version in certbot-auto

* Use pkg_resources in activate test

Due to pip's lack of dependency resolution, the change to use
requests[extras] causes errors in acme.util_test because pkg_resources
accurately detects the "missing" dependency.

There isn't a real problem here. The problem comes from a brand new
requests and ancient pyopenssl as well as a unit test for
functionality we plan to remove in our next release. I modified
the unit test to fix the problem for now.

* Use six instead of pkg_resources for test

* Require requests<=2.11.1 in py27-oldest test

If we don't do this, we get test failures for the certbot package
which is actually a good thing! pkg_resources is catching the
unlikely but possible problem I describe in #3803 and erroring out
saying it is missing the necessary dependencies to run certbot.
Good job package resources.

* Undo changes to acme.util_test
2016-12-01 10:47:08 -08:00
Peter Eckersley
0956e61c7c Remove the sphinxcontrib.programout [docs]dependency (#3830)
- By making a static text file at release time, and including that
   instead.
2016-11-30 10:47:10 -08:00
Jacob Hoffman-Andrews
88076e46c7 Improve debug logs. (#3126)
Print request and response bodies with newlines, rather than all on one line.
Remove "Omitted empty field" log, which gets logged meaninglessly for every JSON
serialization.
Remove duplicated logging of responses.
Log the base64 version of the nonce, rather than turning it into bytes and
logging the backslash-escaped version of those bytes.
Only pass -vv in tests.
2016-10-26 18:07:33 -07:00
Blake Griffith
7773568332 Update ACME error namespace to match the new draft. (#3469)
* Update error namespace in acme package.

* Use new error namespace in certbot.

* fix lint and py26 errors.

* Update with_code docstring.

* @pde's suggestions
2016-10-12 14:46:02 -07:00
Brad Warren
f5bf66ba36 Check version requirements on optional dependencies (#3618)
* Add and test activate function to acme.

This function can be used to check if our optional dependencies are
available and they meet our version requirements.

* use activate in dns_resolver

* use activate in dns_available() in challenges_test

* Use activate in dns_resolver_test

* Use activate in certbot.plugins.util_test

* Use acme.util.activate for psutil

* Better testing and handling of missing deps

* Factored out *_available() code into a common function

* Delayed exception caused from using acme.dns_resolver without
  dnspython until the function is called. This makes both
  production and testing code simpler.

* Make a common subclass for already_listening tests

* Simplify mocking of USE_PSUTIL in tests
2016-10-11 17:50:11 -07:00
Blake Griffith
dcb3fb7382 Use correct Content-Types in headers. (#3566)
* Add Content-Type: app/jose+json to post requests.

* Add tests for proper content type.
2016-10-05 12:28:38 -07:00
Brad Warren
76a92d4cde Release Certbot 0.9.0 (#3583)
* Release 0.9.0

* Bump version to 0.10.0
2016-10-05 10:13:28 -07:00
Brad Warren
da22e64563 Allow tests to pass without dnspython (#3581)
* move skipUnless to test_util

* add skip_unless to acme test_util

* Make dns_resolver_tests work with and without dnspython

* make acme.challenges_test pass when dns is unavailable
2016-10-04 16:49:51 -07:00
Peter Eckersley
1584ee8ac6 Merge pull request #3466 from certbot/all-together-now
DNS challenge support in the manual plugin and general purpose --preferred-challenges flag
2016-09-22 14:15:25 -07:00
Brad Warren
7b7477ab94 Merge branch 'prettify' into all-together-now 2016-08-29 15:20:00 -07:00
Roland Shoemaker
349c2c5915 Switch out error message 2016-08-29 12:04:27 -07:00
Roland Shoemaker
5115e6ac2f Support both invalidEmail and invalidContact errors 2016-08-26 16:17:19 -07:00
Jacob Hoffman-Andrews
2c411056fa Remove obsolete test. 2016-08-19 11:54:35 -07:00
Jacob Hoffman-Andrews
20f9f5ce45 Merge branch 'master' of github.com:certbot/certbot into remove-unnecessary 2016-08-19 10:09:39 -07:00
Mathieu Leduc-Hamel
9958a7fc1c Handle missing dnspython by displaying a warning message 2016-08-18 21:41:33 -04:00
Wilfried Teiken
b2505b996f Switch to always using dnspython (requires dnspthon>=1.12).
Also, address some documentation nits.
2016-07-31 20:36:00 -04:00
Wilfried Teiken
827c93510c Merge branch 'add_dns01_challenge' of github.com:wteiken/letsencrypt into add_dns01_challenge 2016-07-31 20:13:36 -04:00
Ville Skyttä
c7b89c334b Use logger.warning instead of deprecated warn 2016-07-22 09:54:28 +03:00
Peter Eckersley
24cc6b208a Avoid newline 2016-06-22 15:24:33 -07:00
Peter Eckersley
56488b1899 Explain the most likely cause of a missing replay nonce error 2016-06-20 18:18:25 -07:00
Peter Eckersley
b53b47c5d7 Merge pull request #3125 from certbot/lint-lint
Improve user experience for linting.
2016-06-13 14:22:11 -07:00
Jacob Hoffman-Andrews
4f2a8f86d8 Remove unnecessary check on registration returned.
Right now the ACME client checks that the returned registration matches the
registation posted, but there's no guarantee this will always be the case, and
this only introduces unnecessary fragility.
2016-06-13 11:52:36 -07:00
Jacob Hoffman-Andrews
91cd19158e Improve user experience for linting.
Don't run pep8 for directories that we don't actually enforce pep8 on.
Install dependencies with -q.
Don't print reports, they make it hard to find the actual errors.
Remove deprecated fields from acme .pylintrc, they cause unnecessary messages
about deprecation.
2016-06-04 22:53:51 -07:00
Brad Warren
36e63a7372 Bump version to 0.9.0 2016-06-02 13:50:37 -07:00
Brad Warren
dcadcf8d42
Release 0.8.0 2016-06-02 13:50:30 -07:00
bmw
590d816fa9 s/assert_called_once/assert_called_once_with (#3100) 2016-05-31 16:03:42 -07:00
Brad Warren
7153220b41 Bump version to 0.8.0 2016-05-27 13:30:54 -07:00
Brad Warren
46d8f6e18c
Release 0.7.0 2016-05-27 13:30:46 -07:00
bmw
e01878a813 Merge pull request #3034 from chbrown/patch-1
Typo: too many self's
2016-05-26 14:27:56 -07:00
schoen
9a640e01fd Merge pull request #2962 from chrismarget/master
Randomize serial numbers of DVSNI challenge certificates.
2016-05-20 16:39:24 -07:00
Christopher Brown
3aed4fc59d Typo: too many self's
The extra self will push along the arguments, resulting in the accurate but not very helpful error message: "AttributeError: 'JWKRSA' object has no attribute 'kty'"
2016-05-19 14:19:13 -05:00
chrismarget
6dd9991371 Fix invalid attribute for pylint 2016-05-17 20:10:20 +00:00
chrismarget
85e9624555 Added test for random certificate serial numbers from gen_ss_cert. 2016-05-17 19:50:57 +00:00
Jacob Hoffman-Andrews
8f696b3ad7 Reuse HTTP connections. (#2855)
Fixes #2778
2016-05-15 13:48:51 -07:00
Brad Warren
c8cf0b4600 Bump version to 0.7.0 2016-05-11 18:04:27 -07:00
Brad Warren
8e742fa3c6
Release 0.6.0 2016-05-11 18:04:15 -07:00
chrismarget
f7b10bb83e Serial number randomization with improved portability.
No exception handling required this time.
2016-05-11 17:06:29 -04:00
chrismarget
4759bc9034 Trying to make pylint happy. 2016-05-11 16:41:19 -04:00
bmw
255e205c1a Merge pull request #2963 from certbot/ok-directory
Allow unrecognized fields in Directory object
2016-05-11 13:38:09 -07:00
chrismarget
6fbd5fa811 Added missing whitespace. 2016-05-11 16:04:08 -04:00
chrismarget
7f70c09c53 Randomize serial numbers of DVSNI challenge certs.
Should now work on python 2.7 and 3.3+
2016-05-11 15:19:39 -04:00
Jacob Hoffman-Andrews
6f9e28fcca Allow unrecognized fields in directory. 2016-05-11 11:11:52 -07:00
chrismarget
a7ef4940b6 Randomize DVSNI challenge certificate serial number, now for python 3.3. 2016-05-11 13:57:18 -04:00
Jacob Hoffman-Andrews
88499238ed Merge pull request #2797 from kuba/omitempty-error-type-detail
ACME: omitempty Error.detail, Error.type (fixes #2289)
2016-05-11 09:50:09 -07:00
chrismarget
639efaeb7b Randomize serial numbers of DVSNI challenge certificates. 2016-05-11 12:01:53 -04:00
Wilfried Teiken
9396e92a96 Fix lint issues. 2016-04-25 00:46:45 -04:00
Wilfried Teiken
6196cf0aa7 Merge branch 'master' into add_dns01_challenge 2016-04-25 00:40:27 -04:00
Brad Warren
b956a968c6 this commit was authored by the Certbot Project 2016-04-14 16:56:02 -07:00
Brad Warren
ae6f1c62f1 Rename misc files 2016-04-14 10:20:23 -07:00
Jakub Warmuz
0839168de7
Fake deserialization error in test_check_response_not_ok_jobj_no_error 2016-04-10 07:50:39 +00:00
Jakub Warmuz
8145b7c11b
ACME: omitempty Error.detail, Error.type (fixes #2289) 2016-04-09 08:17:26 +00:00
bmw
b347e9fba1 Merge pull request #2775 from kuba/directory-meta
Add Directory.meta (fixes #2768)
2016-04-07 18:37:03 -07:00
Jakub Warmuz
e4076633c8
Add Directory.meta (fixes #2768) 2016-04-06 06:14:31 +00:00
Brad Warren
37817130b0 Bump version to 0.6.0 2016-04-05 17:55:29 -07:00
Brad Warren
4d4cfb414f
Release 0.5.0 2016-04-05 17:55:18 -07:00
Brad Warren
1fe1ac3102 Merge branch 'master' into acme-continuity-cruft 2016-03-07 18:48:30 -08:00
Brad Warren
ec1b14e388 Whatsa DV challenge 2016-03-07 18:47:23 -08:00
Brad Warren
22a9c7e3c2 Remove unused 'other' module 2016-03-07 18:44:30 -08:00
Brad Warren
a941b6830d remove crufty continuity challenges 2016-03-07 18:42:44 -08:00
Erik Rose
55b63fca0d Require setuptools>=1.0 in all packages that use the cryptography lib.
When pip-installing any of these packages, pip hit our permissive, any-version "setuptools" dependency first and then ignored all subsequent, more constrained ones, like cryptography's "setuptools>=1.0". See https://github.com/pypa/pip/issues/988. It thus, on a box with setuptools 0.9.8, stuck with that version. Then, at runtime, letsencrypt crashed because pkg_resources couldn't satisfy cryptography's setuptools>=1.0 requirement.

This change lets us pip-install our packages and have it work. We'll need to make sure our direct requirements (all of them) satisfy the more constrained requirements of our dependencies. Yes, it is disgusting.
2016-03-03 18:02:38 -05:00
Brad Warren
b3166497f0 Merge branch 'master' into keinwerkzeug 2016-02-25 17:16:12 -08:00
Peter Eckersley
593cb3a038 alphabetanit 2016-02-25 16:58:54 -08:00
Peter Eckersley
9a36439e1b Tweaks per review 2016-02-22 17:26:55 -08:00
bmw
356cf890e6 Merge pull request #2482 from pfeyz/acme-example-client-fix
wrap csr in ComparableX509
2016-02-22 09:55:08 -08:00
Jakub Warmuz
29d16b027e
Separate pep8 config for acme. 2016-02-20 11:01:25 +00:00
Peter Eckersley
8d61c86c8c Well actually
We don't need stripping after all.
2016-02-17 16:11:50 -08:00
Peter Eckersley
9fc723f316 Exceptional coverage 2016-02-16 11:52:48 -08:00
Peter Eckersley
a9780c2ddc Test trailing whitespace in headers 2016-02-16 11:15:35 -08:00
Peter Eckersley
7f2ca5d065 Document use of email.utils parser 2016-02-16 11:15:35 -08:00
Peter Eckersley
7c8638f108 Life is simpler if we don't support HTTP/1.0 ACME servers
(Though in practice with py27+ we still support them)
2016-02-16 11:05:11 -08:00
Paul Feitzinger
d6b213d1e3 wrap csr in ComparableX509 2016-02-16 12:00:11 -05:00
Peter Eckersley
49aeffdebb Address some review comments 2016-02-15 12:53:10 -08:00
Wilfried Teiken
7c3271545f Do not log an error when getting NXDOMAIN. 2016-02-13 01:05:35 -05:00
Wilfried Teiken
e8d09ea994 Merge remote-tracking branch 'upstream/master' into add_dns01_challenge 2016-02-12 23:32:34 -05:00
Brad Warren
45ee1eb889 Merge branch 'testing-dev-extras' 2016-02-12 16:19:57 -08:00
Brad Warren
e493a0deff Merge branch 'acme-new-authz-directory' 2016-02-12 16:11:56 -08:00
Peter Eckersley
6fd3dba737 Two digit years are used/tested in py26 only 2016-02-12 15:08:32 -08:00
Peter Eckersley
c3ddb47cfa All this import voodoo is not required for py2.6+ 2016-02-12 12:59:53 -08:00
Peter Eckersley
f1faedaa72 This two digit year case is hard to trigger 2016-02-12 12:48:20 -08:00
Peter Eckersley
0afb424173 py26 doesn't like adding lists & tuples 2016-02-12 12:29:13 -08:00
Peter Eckersley
ae69a74465 Tidy 2016-02-12 11:38:26 -08:00
Peter Eckersley
ca7f190efc lint & cover 2016-02-12 11:29:36 -08:00
Peter Eckersley
6f99d9f3d9 fixen 2016-02-11 18:22:41 -08:00
Peter Eckersley
a34dc94b1c bugfixes & minimalism 2016-02-11 17:28:07 -08:00
Peter Eckersley
ef404d4985 slightly simpler / more compact 2016-02-11 16:12:42 -08:00
Peter Eckersley
0ecaa8abca rm unused var 2016-02-11 15:45:51 -08:00
Peter Eckersley
df383ee6e4 Remove werkzeug dependency by parsing Retry-After ourselves
Fixes #2409
Progress on #1301
2016-02-11 15:44:23 -08:00
Peter Eckersley
563c115044 Bump version to 0.5.0 2016-02-10 18:49:27 -08:00
Peter Eckersley
74063851e3
Release 0.4.0 2016-02-10 18:48:40 -08:00
Peter Eckersley
b6d0632a10 Bump version to 0.4.0 2016-01-27 17:05:25 -08:00
Peter Eckersley
cf218dd7f1
Release 0.3.0 2016-01-27 15:12:30 -08:00
Rémy HUBSCHER
b8690cd471 Make wheel universal 2016-01-21 10:11:23 +01:00
bmw
30d8394535 Merge pull request #2199 from letsencrypt/0.2.0
Include 0.2.0 release in master's history, and bump version
2016-01-19 17:56:44 -08:00
bmw
8301f2f57b Merge pull request #1665 from erikrose/letsencrypt-auto-release
Make letsencrypt-auto release-suitable, self-upgrading, and self-contained.
2016-01-19 15:16:49 -08:00
Jakub Warmuz
3a90b4c7c5
acme: fix empty set repr py3 compat 2016-01-18 21:39:25 +00:00
Peter Eckersley
5535c0675b Revert "Revert "Fix "global" max_attempt bug (#1719)"" 2016-01-18 12:46:10 -08:00
Peter Eckersley
e87de72662 Revert "Fix "global" max_attempt bug (#1719)" 2016-01-18 12:13:51 -08:00
Peter Eckersley
e93c16a11b Merge pull request #2111 from kuba/bugs/1719
Fix "global" max_attempt bug (#1719)
2016-01-18 11:39:59 -08:00
Erik Rose
e1bd1645b6 Revert moving mock to test_requires.
We'll take this up later, but I don't want to hold up the new le-auto on this debate.
2016-01-15 18:25:26 -05:00
Peter Eckersley
91d958aa59 Bump version to 0.2.1.dev0 2016-01-15 15:03:53 -08:00
Erik Rose
ecbe2a5c69 Merge master in to get the unconditionalization of dependencies. 2016-01-15 13:43:36 -05:00
Wilfried Teiken
c15581bcfd Fix lint problems. 2016-01-14 23:37:05 -05:00
Wilfried Teiken
b65da1da76 Merge branch 'add_dns01_challenge' into test-add_dns01_challenge 2016-01-14 23:05:49 -05:00
Wilfried Teiken
b9dafc203f Merge branch 'master' into add_dns01_challenge 2016-01-14 23:01:06 -05:00
Brad Warren
e59fcf7ddd
Release 0.2.0 2016-01-14 17:39:18 -08:00
Brad Warren
2e034e6c6c Revert changes to acme's setup.py 2016-01-14 11:42:10 -08:00
Erik Rose
2771249522 Merge master in before computing a known-good set for 0.2.0.
This also serves as a suitable base to build sdists for isnot.org, so we can try the old le-auto script against mockless versions of the LE packages.
2016-01-13 18:23:51 -05:00
Erik Rose
c3ea4bdc9b Roll back change to acme's pylintrc, which was needed to get lint to pass on Travis's Trusty beta (sudo) infra.
We're stepping off that infra briefly, to keep it the same as boulder's. When we retire the old le-auto, we'll step back on and change boulder to use it as well.
2016-01-13 17:22:59 -05:00
Peter Eckersley
9500f2b3c3 Merge pull request #2139 from kuba/acme-pylint-80
ACME: pylint to 80 chars
2016-01-13 00:31:02 -08:00
bmw
de89eb89e2 Merge pull request #2135 from kuba/acme-client-dead-error
Remove dead code (error in except)
2016-01-12 14:50:15 -08:00
bmw
9167871a82 Merge pull request #2132 from kuba/acme-account-key-none-docs
Fix wrong doc comment: account_public_key is None
2016-01-12 14:49:43 -08:00
bmw
591f0376e8 Merge pull request #2089 from wteiken/fix_regr_from_resource
Update new_authzr_uri when querying or updating a registration
2016-01-12 14:45:54 -08:00
Erik Rose
a3288a92b9 Disable too-many-instance-attributes for the acme linter.
This should make the linter pass and allow us to merge the letsencrypt-auto-release branch when it's ready. IHNI why it passes on master without this disabled.
2016-01-12 14:25:36 -05:00
Erik Rose
ed562645e0 Master master into letsencrypt-auto-release so Travis will build it. 2016-01-11 21:45:16 -05:00
Erik Rose
6c05197a43 Remove mock as an install requirement.
The motivation is to free us of a reliance on a rather modern version of setuptools, which caused le-auto failures for people on Wheezy and other older distros. (The alternative would have been to forcibly upgrade setuptools as the old le-auto did, but less is more.)

Mock is used only in tests, so we move it to tests_require. It will still be installed automatically when setup.py test is run. Give all packages a test_suite so this works.

The "testing" extra remains for optional packages not required for the nose tests but used in tox. However, the extra is much less useful now and is a candidate for deletion. We could roll the list of packages therein into the tox config so as not to favor any particular package.

Remove tests_require=install_requires, which I don't think does anything useful, since install requirements are implicitly installed when running setup.py test.

Fix tests to pass with mock removed. We had to stop them pulling down LE from PyPI, since the current version there (0.1.1) requires mock and explodes when `letsencrypt` is run.
2016-01-11 21:26:41 -05:00
Wilfried Teiken
05a61c181b Lint fixes. 2016-01-10 21:42:20 -05:00
Wilfried Teiken
9179276cb9 Modify dns_resolver_test to skip tests if dnspython is not available. 2016-01-10 20:59:11 -05:00
Wilfried Teiken
1ff121b616 pcoverage fix 2016-01-10 18:08:16 -05:00
Wilfried Teiken
2d8de74f4a pcoverage fix 2016-01-10 17:13:25 -05:00
Wilfried Teiken
0010610a4a py3X fix 2016-01-10 17:06:03 -05:00
Wilfried Teiken
cfe56cbd92 2.6 compatible skipping of tests. 2016-01-10 17:00:14 -05:00
Jakub Warmuz
bdd9fa4485
Quickfix too-many-instance-attributes.
https://github.com/letsencrypt/letsencrypt/pull/2135#issuecomment-170381179
2016-01-10 18:47:04 +00:00
Jakub Warmuz
86d6d27045
Clean up dev/testing extras messup (fixes #2140). 2016-01-10 18:37:41 +00:00
Jakub Warmuz
fac2ed41d8
ACME: pylint to 80 chars 2016-01-10 18:17:35 +00:00
Jakub Warmuz
31a64a0e9f
ACME: default to new_authzr_uri form Directory 2016-01-10 18:01:58 +00:00
Wilfried Teiken
49c40e7a58 Skip dns_resolver tests if dnspython is not available. 2016-01-10 13:00:38 -05:00
Wilfried Teiken
f2b52bd830 Fix dcumentation 2016-01-10 12:58:29 -05:00
Jakub Warmuz
0a536d50be
Remove dead code (error in except) 2016-01-10 17:31:50 +00:00
Jakub Warmuz
c10bfd6efc
Fix wrong doc comment: account_public_key is None 2016-01-10 14:01:34 +00:00
Jakub Warmuz
3cddb15023
Merge remote-tracking branch 'github/letsencrypt/master' into pyopenssl 2016-01-10 11:25:12 +00:00
Jakub Warmuz
1182dcf0c2
Merge remote-tracking branch 'github/letsencrypt/master' into acme-pylint 2016-01-10 11:17:03 +00:00
Peter Eckersley
bf4793039a Merge remote-tracking branch 'origin/master' into pyopenssl 2016-01-10 02:39:54 -08:00
Wilfried Teiken
d842f268e5 - Use dnspython3 fir py3X environments.
- Fix encoding for simple_verify.
2016-01-09 17:07:20 -05:00
Wilfried Teiken
e7ce5e9f53 Merge branch 'master' into add_dns01_challenge 2016-01-09 15:19:47 -05:00
Wilfried Teiken
446994e8ef Limit length of try block. 2016-01-09 14:58:19 -05:00
Jakub Warmuz
b26dda3afe
Add Python 3.5 trove classifier to acme 2016-01-09 13:38:12 +00:00
Jakub Warmuz
a367c98409
Merge remote-tracking branch 'github/letsencrypt/master' into acme-pylint 2016-01-09 12:50:13 +00:00
Erik Rose
f2586fbc11 Merge master in so Travis will test this PR. 2016-01-08 17:08:30 -05:00
bmw
96b55c8f34 Revert "Don't use cryptography version 1.2" 2016-01-08 17:02:35 -05:00
Erik Rose
1d719bd89c Teach le-auto about dependencies that are conditional on the Python version. 2016-01-08 15:31:22 -05:00
Brad Warren
b1e67f241e Fix merge conflicts properly 2016-01-08 14:31:30 -05:00
Brad Warren
36679c2daa Merge branch 'master' into pyopenssl 2016-01-08 14:27:07 -05:00
Brad Warren
a7a7380110 Merge branch 'master' into pyopenssl 2016-01-08 14:26:13 -05:00
Brad Warren
b039c884d8 Don't use cryptography version 1.2 2016-01-08 14:09:44 -05:00
Brad Warren
639cbeb7d0 sans_text_dump_comment += 1 2016-01-07 21:11:09 -05:00
Jakub Warmuz
dba69d079f
Separate pylintrc for acme 2016-01-07 22:20:46 +00:00
Jakub Warmuz
cc168c8ef1
Generate fresh pylintrc
pylint 1.4.2, -generate-rcfile
2016-01-07 22:17:42 +00:00
Brad Warren
946f4474da Add warning about multiple SANs extensions 2016-01-07 16:45:46 -05:00
Brad Warren
32957cc5ec Comment _pyopenssl_cert_or_req_san method 2016-01-07 16:25:23 -05:00
Jakub Warmuz
6548f343bf
Add invalidEmail error type to acme
Related to:
- #1923
- https://github.com/ietf-wg-acme/acme/pull/65
2016-01-07 21:20:25 +00:00
Brad Warren
710eb59f41 Fix IDN CSR test name 2016-01-07 16:19:21 -05:00
Jakub Warmuz
a36a59ba6c
Fix waiting->exhausted in PollError tests 2016-01-07 20:31:40 +00:00
Jakub Warmuz
4d04d14b20
Fix "global" max_attempt bug (#1719) 2016-01-07 20:25:07 +00:00
Jakub Warmuz
fea4b24fb8
Add test to discover "global" max_attempt bug (#1719) 2016-01-07 20:20:57 +00:00
Brad Warren
0f239e0029 Add comment about dependency version 2016-01-07 13:04:29 -05:00
Brad Warren
caf9b1f261 Clarify _get_idn_sans method 2016-01-07 13:00:29 -05:00
Wilfried Teiken
02a493011e Remove superfluous except: and change Exception returned if dnspython is not
available.
2016-01-06 22:56:59 -05:00
Brad Warren
0b1e1d0937 Use test_util.load_cert 2016-01-06 22:07:45 -05:00
Brad Warren
51bc1311a2 Fixed rogue quotes 2016-01-06 15:34:42 -05:00
Brad Warren
1cdff156c9 Add IDN test 2016-01-06 15:33:36 -05:00
Brad Warren
96114ba84e Add IDN SANs CSR and cert 2016-01-06 15:10:08 -05:00
Brad Warren
ba93c57697 Added large sans cert and csr test 2016-01-06 14:22:13 -05:00
Brad Warren
32650a6d08 Added 100 SANs cert and csr 2016-01-06 14:10:57 -05:00
Brad Warren
1af997158d Fix repr differences between PyOpenSSL versions 2016-01-06 13:39:14 -05:00
Brad Warren
6f7299f9ed Merge branch 'master' into pyopenssl 2016-01-06 12:40:56 -05:00
Brad Warren
6719d0d380 Rewrote _pyopenssl_cert_or_req_san 2016-01-06 12:40:44 -05:00
Wilfried Teiken
6bc3060fbb More fixes for travis tests 2016-01-06 03:11:09 -05:00
Wilfried Teiken
b73b410729 Exclude import error case from coverage in dns_resolver 2016-01-06 02:59:25 -05:00
Wilfried Teiken
52c487f462 Add new 'test' extras and update tox.ini accordingly. 2016-01-06 02:44:19 -05:00
Wilfried Teiken
d2ced2de6a Dep fixes for lint/coverage. 2016-01-06 01:48:12 -05:00
Wilfried Teiken
a9a5e60bc5 Added requirements for coverage and lint. 2016-01-06 01:26:32 -05:00
Wilfried Teiken
dc743fb57c Move DNS resolver to separate module to decouple dependencies and testing. 2016-01-06 01:11:24 -05:00
Wilfried Teiken
57c265c7f3 Setup.py and style fixes 2016-01-06 00:27:07 -05:00
Wilfried Teiken
fd2709a6fa Move dnspython dependency to tests only and only import the dns.resolver when
actually resolving the client.  That way user code that does not call
'simple_verify' for DNS01 challenges does not depend on dnspython.
2016-01-05 23:58:23 -05:00