Commit Graph
7303 Commits
Author SHA1 Message Date
Brad Warren 3ba07724dd use --pref-chall for dns integration 2016-12-09 17:12:35 -08:00
Brad Warren dd118100e2 add --manual-public-ip-logging-ok to integration tests 2016-12-09 17:00:00 -08:00
Brad Warren 846b315777 they're hooks, not scripts 2016-12-09 16:44:45 -08:00
Brad Warren b9e6f84627 remove references to the script plugin 2016-12-09 16:34:30 -08:00
Brad Warren 4cb7f0b885 Add manual DNS script integration test 2016-12-09 16:25:17 -08:00
Brad Warren 23d8c2a59c add manual http scripts 2016-12-09 16:21:15 -08:00
Brad Warren 296804b642 Add HTTP manual hook integration test 2016-12-09 15:39:37 -08:00
Brad Warren 967d97a557 finish manual tests 2016-12-09 14:39:24 -08:00
Brad Warren d28d9b9eed simplify perform and cleanup environment 2016-12-09 13:16:41 -08:00
Brad Warren ed186b6c83 use bad response/validation methods on achalls 2016-12-09 11:49:01 -08:00
Brad Warren 53629d1bab Revert "make achall more helpful"
This reverts commit 54b01cea30.
2016-12-09 11:46:04 -08:00
Brad Warren c85e7c9f34 stop using manual_test_mode in cli tests 2016-12-09 11:20:41 -08:00
Brad Warren 52d8cb346e fix ParseTest.test_help 2016-12-09 10:58:34 -08:00
Brad Warren aa18ec214f add start of manual_tests 2016-12-09 10:55:06 -08:00
Brad Warren d7f5d27c02 remove old test files 2016-12-09 10:46:42 -08:00
Brad Warren 9fea35e450 simplify perform 2016-12-09 10:44:39 -08:00
Brad Warren 54b01cea30 make achall more helpful 2016-12-09 10:40:40 -08:00
Brad Warren ba5d120500 remove unneeded response argument 2016-12-09 10:29:33 -08:00
Brad Warren d0f3949e58 fix spacing on instructions 2016-12-09 10:21:48 -08:00
Brad Warren 9d2fd70518 s/script/hook 2016-12-08 17:32:10 -08:00
Brad Warren e65c3f1720 specify chall for uri 2016-12-08 16:22:20 -08:00
Brad Warren 152a5d543d use consistent quotes 2016-12-08 16:16:49 -08:00
Brad Warren df0d60a8e2 manually specify we want chall.token 2016-12-08 16:16:19 -08:00
Brad Warren 683a5ff3d0 delete old manual and script plugins 2016-12-08 16:06:34 -08:00
Brad Warren 7ab371eeee finish manual/script rewrite 2016-12-08 16:05:09 -08:00
Brad Warren 550ba19b32 Return str from hooks.execute, not bytes 2016-12-08 12:22:15 -08:00
Brad Warren 2cb558ff18 Start of combined manual/script plugin 2016-12-06 18:28:44 -08:00
Kenneth SkovhedeandPeter Eckersley 184d673378 Busybox support (#3797)
* Added support for shells without default variable support

* Added support for BusyBox installs that do not have `command` but has `which`

* Style fixes as suggested by reviewer

* Renamed `WHERE_IS` to `EXISTS` as suggested by review

* Removed expansion of `$LE_AUTO_SUDO` to `x` as the `-n` can check empty strings.

* Added `EXISTS` to debian bootstrap as suggested in review
2016-12-05 19:40:07 -08:00
Erica PortnoyandPeter Eckersley f0a7bb0e33 Mark Nginx vhosts as ssl when any vhost is on ssl at that address (#3856)
* Move parse_server to be a method of NginxParser

* add super equal method to more correctly check addr equality in nginx should we support ipv6 in nginx in the future

* add addr:normalized_tuple method

* mark addresses listening sslishly due to another server block listening sslishly on that address

* test turning on ssl globally

* add docstring

* lint and remove extra file
2016-12-05 19:17:04 -08:00
Timothy Guan-tin ChienandPeter Eckersley 3dbf5c9fcb certbot-auto: Print link to doc on debugging pip install error [revision requested] (#3473)
* certbot-auto: Print link to doc on debugging pip install error

Also, update the doc to teach the user to workaround problem on a low
memory system.

* Correct formatting

* grep the PIP_OUT and print useful info if the problem is about memory allocation

* Fix logic on string to grep
2016-12-05 18:49:38 -08:00
Brad WarrenandPeter Eckersley feef1b411b Add pyasn1 back to le-auto (#3858) 2016-12-05 17:00:04 -08:00
Blake GriffithandErica Portnoy 65d9e997e5 Refactor cli_test.py and main_test.py (#3828)
* Begin breaking out cli_test.py

* simplify main

* refactor porse tests

* move determine account tests to main_test.py

* move duplicate cert test to main_test.py

* move cli stuff out of the way

* add test_renewal.py

* move error test into error_handler_test.py

* move test_read_file

* move test_no_gui out of MainTest

* move test_install_abspath to parsetest

* Move main tests into main_test.py

* move cli tests back into cli_test.py

* clean up cli_test.py

* move punycode test to util_test.py

* Fix NameError from missing plugins_disco

* Fix linting errors

* test_renewal.py -> renewal_test.py

* rm not_cli_test.py

* Move main._handle_exception test to main_test.py

* Move renewal import in renewal_test.py

from @ohemorange comments

* certbot.tests.test_util -> certbot.tests.util

* Fix issues from rebasing.

* Fix testing issue with option_was_set

* fix linting issue
2016-12-05 15:22:14 -08:00
Peter EckersleyandBrad Warren 93f0846fa4 Testfarm test new leauto (#3845)
Test farm tests should test the version of letsencrypt-auto that's in the git tree, not the one from the previous release.


* Test the new leauto, not the previously released one
2016-12-05 09:09:43 -08:00
Brad WarrenandPeter Eckersley da3332ccfa Security enhancement cleanup (#3837)
* Stop passing around config and refactor tests

* Refactor and warn during enhance_config

* Use mock.ANY to make new Pythons happy

* Remove verbose enhance_config from test names

* Fix spacing in warning
2016-12-02 16:03:55 -08:00
Peter EckersleyandGitHub 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 WarrenandPeter Eckersley 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
Brad WarrenandPeter Eckersley 0289457a93 Use ${foo+x} not ${foo:+x} (#3833) 2016-11-30 16:09:16 -08:00
Mario VillaplanaandBrad Warren ec0cd4d538 Warn early if a selected enhancement is unsupported by the current plugin (#3688)
Certbot currently silently allows a user to specify enhancements that are
unsupported by the chosen plugin. This adds an early warning message
indicating when a selected enhancement isn't supported by a plugin.
2016-11-30 10:50:16 -08:00
Peter EckersleyandBrad Warren 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
Craig SmithandPeter Eckersley 83966cdfcf Fixed output (#3637). (#3809) 2016-11-29 16:53:06 -08:00
Craig SmithandPeter Eckersley df5f08843f Output success message for revoke command (#3823)
* Output status for `revoke` operation. Fixes #2819.

    - Added method to `certbot.display.ops` to output confirmation of `revoke`.

    - Wrapped call to `acme.client.Client.revoke` in a try to statement to
      handle possible error.

    - Added test for `main.revoke`.

* Added test for failure of certificate revocation.

Moved creation of mocks into RevokeTest setup function.

Stopped mocks in RevokeTest teardown function.

* Fixed lint errors.

* Do not call `unittest.TestCase.assertRaises` as a context manager (to work with py26).

* Fixed spelling error in successful revocation notification.

Added test for the notification.
2016-11-29 15:30:37 -08:00
Brad WarrenandPeter Eckersley 7951ba7337 pin pyopenssl 16.2.0 in certbot-auto (#3811) 2016-11-23 14:00:48 -08:00
Min RKandBrad Warren 908e8a80a9 disallow binary (wheel) install for pycparser (#3575)
* disallow binary (wheel) install for pycparser

pycparser has uploaded a broken wheel for 2.14, failing for two reasons

1. sha mismatch, due to not instructing pip which dist to install
2. bug in the wheel itself

* regen letsencrypt-auto-source/letsencrypt-auto
2016-11-22 10:18:32 -08:00
Brad WarrenandPeter Eckersley 494c305b04 pin requests version in py26-oldest (#3803) 2016-11-21 17:56:22 -08:00
Brad WarrenandPeter Eckersley e5f4d0cb5c Fix reinstall message (#3784)
* Changed informational messages because of confusing message on reinstallation.

Certbot prompts the user when it detects that an appropriately fresh certificate
is already available:

        You have an existing certificate that contains exactly the same domains you requested and isn't close to expiry.
        (ref: <path>)

        What would you like to do?
        -------------------------------------------------------------------------------
        1: Attempt to reinstall this existing certificate
        2: Renew & replace the cert (limit ~5 per 7 days)
        -------------------------------------------------------------------------------
        Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 1

On selecting '1' (reinstall), the resulting message is:

        -------------------------------------------------------------------------------
        Your existing certificate has been successfully reinstalled, and the new
        certificate has been installed.

        The new certificate covers the following domains: https://<whatever>

        You should test your configuration at:
        https://www.ssllabs.com/ssltest/analyze.html?d=<whatever>
        -------------------------------------------------------------------------------

"Your existing certificate has been successfully reinstalled" <-- Okay

"and the new certificate has been installed." <-- Wait, what?

The issue appears to come from assumptions in certbot/certbot/main.py

It uses `len(lineage.available_versions("cert"))` to determine if this was a
fresh install or renewal, and then calls either `display_ops.success_renewal()`
(which produces the "existing certificate ... and the new certificate" language)
or `display_ops.success_installation()` (which has no messaging about existing
vs. new certificates).

The len(lineage) test isn't the right way to make this choice. The certificate's
lineage length doesn't imply anything about whether we've just obtained a new
certificate, because there is no new certificate in the case of a "reinstall"
action.

The new logic calls `display_ops.success_installation()` on all "reinstall"
actions, and otherwise employs the existing `len(lineage)` test.

Additionally the `display_ops.success_installation()` has been enhanced to
accept an action parameter, and has the message reworded slightly to make
sense regardless of the action passed. The messaging is mostly unchanged if it's
called without the action parameter:

Original message:
        -------------------------------------------------------------------------------
        Congratulations! You have successfully enabled https://<whatever>

        You should test your configuration at:
        https://www.ssllabs.com/ssltest/analyze.html?d=<whatever>
        -------------------------------------------------------------------------------

New message on initial install:
        -------------------------------------------------------------------------------
        Congratulations! You have successfully installed a certificate for
        https://<whatever>

        You should test your configuration at:
        https://www.ssllabs.com/ssltest/analyze.html?d=<whatever>
        -------------------------------------------------------------------------------

New message on re-install:
        -------------------------------------------------------------------------------
        Congratulations! You have successfully reinstalled a certificate for
        https://<whatever>

        You should test your configuration at:
        https://www.ssllabs.com/ssltest/analyze.html?d=<whatever>
        -------------------------------------------------------------------------------

* Typo in display message.

* Typo, characters transposed.

* undo changes to certbot/display/ops.py

* remove invalid todos

* Test success_installation() called for reinstall

* Simplify display_ops.success* functions

* refactor and expand run() tests
2016-11-15 11:56:05 -08:00
Brad WarrenandPeter Eckersley 3dbeef8ee7 fix --http-01-port typo at source (#3794) 2016-11-15 11:45:07 -08:00
Henri SaloandErica Portnoy 9aef15d09e Fix typo (#3790) 2016-11-14 10:58:14 -08:00
Brad WarrenandPeter Eckersley 1dd1afdc57 Remove letshelp-letsencrypt (#3775) 2016-11-10 23:04:41 -08:00
Amjad MashaalandBrad Warren 1e27e43c14 Expanding tests for le-auto, adding CentOS test suite (#2671)
* Adding Dockerfile for CentOS 6

* Adding CentOS 7 to LEA tests

* Enabling CentOS 6 LEA test

* Removing CentOS 7

* Fixing nits

* Using yum to install epel-release
2016-11-10 15:05:03 -08:00
Amjad MashaalandBrad Warren c89bd421da Expanding tests for le-auto, adding Debian test suite (#2635)
* Adding Debian 7 (Wheezy) to LE tests

* Adding Debian 8 (Jessie) to LE tests

* Fixing Debian Wheezy certificate addition error

* Adding packages to LEA Debian Jessie test and refining the code commenting

* Adding installing OpenSSL to the Debian Wheezy LEA test script

* Removing LEA tests for Debian Jessie

* Fixing nits
2016-11-10 14:01:15 -08:00