1
0
mirror of https://github.com/certbot/certbot.git synced 2025-09-10 22:11:53 +03:00

328 Commits

Author SHA1 Message Date
ohemorange
8ad18cbe6e Use ffdhe2048 Nginx DH params to fix Weak-DH bug (#4973)
* Rename plugins.common.install_ssl_options_conf to plugins.common.install_version_controlled_file

* Install ssl_dhparams file

* Add installation test

* Add ssl_dhparam option when making a server block ssl

* add install_ssl_dhparams to Installer common plugin class

* Remove redundant code and tests

* update MANIFEST.in
2017-09-01 07:57:30 -07:00
Brad Warren
ae0be73b53 Make common Installer base class (#5055)
* Add installer class

* Add wrapped reverter methods to common.Installer.

* Use Installer class in Apache plugin

* Use Installer class in Nginx plugin

* Don't create reverter in Apache and Nginx plugins
2017-08-28 17:06:09 -07:00
Noah Swartz
df71ec33b3 switch from triple quotes to single quotes 2017-08-28 13:45:42 -05:00
Noah Swartz
2c9e072a9f link to nginx documentation 2017-08-15 17:39:23 -07:00
Noah Swartz
4d72fa42e3 expand nginx no name error 2017-08-15 17:00:03 -07:00
Brad Warren
d4676610e9 Unhide Nginx (#4969)
* Be careful with new interaction from enabling nginx

* Fix py3 compataibility & better docs

* Make minor changes to @pde's PR to unhide nginx

* unhide nginx plugin

* Only protect against nginx interaction in cb-auto
2017-08-07 08:36:41 -07:00
ohemorange
0321c0cb4c Change add_server_directives replace=True behavior to attempt to replace, but append on failure to find. (#4956)
* Change add_server_directives replace=True behavior to attempt to replace, but append on failure to find.

* Remove try/except around add_server_directives
2017-07-26 13:57:25 -07:00
Brad Warren
828363b21a Fix nginx --dry-run (#4889)
* Revert "Don't save keys/csr on dry run (#4380)"

This reverts commit e034b50363.

* Don't save CSRs and keys during dry run

* Factor out _test_obtain_certificate_common

* Add test_obtain_certificate_dry_run

* Wrap key from make_key in util.Key

* Wrap result from make_csr in util.CSR
2017-06-30 08:10:55 -04:00
Brad Warren
d25069d89b Remove reference to .new in Nginx's SSL options. (#4769) 2017-06-01 15:26:54 -07:00
ohemorange
fc097de5ff Refactor nginx file update mechanism in preparation for working with apache plugin (#4720)
* move install_ssl_options_conf functionality to common

* add no cover

* compute current hash instead of saving

* make current hash be computed; switch to list of all canonical hashes

* put message directly into assertion

* don't pass logger

* add docstring

* Add unit tests for certbot.plugins.common.install_ssl_options_conf
2017-06-01 09:04:48 -07:00
ohemorange
033c995bd2 Update options-ssl-nginx.conf inprepare if it hasn't been manually modified (#4689)
Fixes #4559.

* Update options-ssl-nginx.conf in prepare, if it hasn't been modified.

* add previous options-ssl-nginx.conf hashes

* InstallSslOptionsConfTest

* remove .new file and only print warning once

* save digest to /etc/letsencrypt

* add comment reminding devs to update hashes

* add comment and test for sha256sum

* treat hash file as text file because python3

* move constants and rename hidden digest file
2017-05-23 13:18:50 -07:00
ohemorange
23e6c28d80 Allow Nginx to insert include files with comments inside (#4666)
* add failing test case

* allow include files to insert comments

* lint
2017-05-15 15:30:50 -07:00
ohemorange
a5bd0cf50c Add a test for #4557 (#4609) 2017-05-02 18:37:54 -07:00
ohemorange
7016874243 Switch to using include directive for Nginx constants (#4557)
* Switch to using include directive for Nginx constants

* remove deprecated comment

* give better error message when attempting to insert an existing directive

* make code more readable

* add docstrings

* allow a duplicated directive if it's identical

* comment out precisely repeated directives

* add comments
2017-05-02 17:56:56 -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
yomna
72fa27514e fix for issue 4132: increasing server_names_hash_bucket_size if necessary (#4496)
* increases server_names_hash_bucket_size if it's too low in your nginx conf

* switching from k,v pairwise indices -> inner_line

* simply using bucket_directive
2017-04-27 10:46:33 -07:00
ohemorange
1611df4120 Allow empty nginx blocks (#4555)
* modify test config file to allow valid config that fails to parse in parser.py

* make failing tests pass by fixing the problem
2017-04-26 18:44:06 -07:00
Yen Chi Hsuan
031a8dd837 Fix nginx integration tests on Python 3 2017-04-15 02:34:06 +08:00
Erica Portnoy
d09bde972a Remove unused default parameter (#4447)
* Remove unnecessary, nonexistent default
2017-03-30 15:28:24 -07:00
Erica Portnoy
52e22b22e5 Add additional Nginx parsing test case (#4440) 2017-03-30 07:47:36 -07:00
Erica Portnoy
ece68a1864 Update Nginx ciphersuites to use Mozilla Intermediate (#4426)
* Update Nginx ciphersuites to use Mozilla intermediate

* update tests to match new behavior
2017-03-27 15:19:03 -07:00
Erica Portnoy
7be2e79025 Fix nginx parser (#4296)
* rewrite nginx parser to allow everything that nginx does

* also make changes in tls_sni_01.py

* add test case with

* allow embedded variables

* allow empty ${} variable

* fix quotes

* un-special case if

* update all tests to reflect current parsing

* escape in QuotedString after merge

* add test cases for variable weirdness that are almost certainly nginx bugs

* update regex for correct variable rules

* close paren doesn't invoke last_space

* Make test file valid Nginx syntax
2017-03-24 19:45:53 -07:00
Daniel Huang
e034b50363 Don't save keys/csr on dry run (#4380)
* Don't save keys/csr on dry run (#2495)

* Replace assertIsNone for py26

* Fix config defaults for compat tests
2017-03-18 13:42:54 -07:00
Erica Portnoy
050d272272 Merge pull request #4347 from kernelpanek/master
Fixes nginxparser to allow multiline quoted strings
2017-03-17 16:48:32 -07:00
Yen Chi Hsuan
4cad594b4b Python 3 compatibility for all tests (#4358) 2017-03-17 13:10:02 -07:00
Erica Portnoy
5fa2080558 If we fail to reload Nginx, write to temporary files instead of piping output (#4333)
Due to issues with piping and Nginx on Arch.
2017-03-15 17:05:52 -07:00
Richard Panek
f791af5afe New switch for QuotedStrings allows retainer of quotes but my test fails 2017-03-15 02:13:09 -06:00
kernelpanek
e715b49dd2 Don't unquote the results of the parse 2017-03-15 01:26:16 -06:00
kernelpanek
5758b1687d Fixes issue when parsing an Nginx configuration file containing multiline quoted strings 2017-03-15 00:25:26 -06: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
Erica Portnoy
e5909d379c Don't crash on listen unix: (#4259)
Fixes #4225.

* don't crash on listen unix:

* correctly merge #4221
2017-02-27 13:35:29 -08:00
silverwind
b1a4280519 Show error details for the nginx config parser (#4221)
Nginx parser errors now include helpful details on where parsing has
actually failed.

Related: https://github.com/certbot/certbot/issues/3798
2017-02-22 18:50:56 -08:00
Amjad Mashaal
1fd847e216 Adding checking name validity to the Apache plugin (#3639) 2017-02-01 07:12:51 -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
Erica Portnoy
c00568a518 Break on failure to deploy cert (#4003)
* Break on failure to deploy cert

* Add error message for unable to install cert

* Add unit test
2017-01-10 17:27:09 -08:00
Ondřej Surý
06e07ca49b pyparsing.restOfLine is not a function, don't call it (#3989) 2017-01-09 18:29:02 -08:00
Clif Houck
ad53c80c1e Fix certbox-nginx address equality check (#3886)
0.0.0.0, *, and '' are equivalent hosts to nginx. Changes Addr object's
equality testing to treat them as equal.

Fixes #3855
2016-12-13 14:38:57 -08:00
Brad Warren
9bdb3d67bc make our linter happy (#3881) 2016-12-08 20:29:59 -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
Erica Portnoy
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
Blake Griffith
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
Nick Fong
dd8772b608 Remove get_all_certs_keys() from Apache and Nginx (#3768)
- Remove get_all_certs_keys() implementation in
    - certbot-apache/certbot_apache/configurator.py
- Remove corresponding tests for get_all_certs_keys() in
    - certbot-apache/certbot_apache/tests/configurator_test.py
- Remove get_all_certs_keys() implementation in
    - certbot-nginx/certbot_nginx/configurator.py
    - certbot-nginx/certbot_nginx/parser.py
- Remove corresponding tests for get_all_certs_keys() in:
    - certbot-nginx/certbot_nginx/tests/configurator_test.py
    - certbot-nginx/certbot_nginx/tests/parser_test.py

Resolves #3762
2016-11-08 17:19:05 -08:00
Erica Portnoy
df10a6431b Don't re-add redirects if one exists (#3751)
* Don't re-add redirects if one exists

* coverage

* make coverage happy

* don't re-add comment, and clean code
2016-11-07 15:48:46 -08:00
kaiyou
82c69815d1 Fix writing pem files with Python3 (#3757)
* Standardize arguments name for mode and chmod in the util API

* Handle OpenSSL pem as bytes objects only for Python3 compatibility

* Handle OpenSSL pem as bytes objects only (remaining bits)

* Manipulate bytes objects only when testing PEM-related functions

* Fix argument order when calling util.unique_file
2016-11-07 14:22:20 -08:00
Erica Portnoy
ce252bd6c9 Allow certbot to get a cert for default_servers (#3652)
* Allow certbot to get a cert for default_servers

* Add to_string method for not printing default_server
2016-10-21 13:56:53 -07:00
Erica Portnoy
4bc3c747cb Mark parsed Nginx addresses as listening sslishly when an ssl on directive is included in the server block. (#3607) 2016-10-10 19:04:35 -07:00
Erica Portnoy
c9bc034512 Update Nginx redirect enhancement process to modify appropriate blocks (#3546)
* Cache the vhost we find during nginx deployment for OCSP enhancement.

* Refactor to pass domain into enhancement functions

* Add https redirect to most name-matching block listening non-sslishly.

* Redirect enhancement chooses the vhost most closely matching target_name that is listening to port 80 without using ssl.

* Add default listen 80 directive when it is implicitly defined
2016-09-29 16:16:07 -07:00
Erica Portnoy
9f2dfc15fe Restructure how Nginx parser re-finds vhosts, and disable creating new server blocks. (#3528)
* Restructure add_server_directives to take a vhost as argument. This is the first step towards fixing vhost selection in nginx.

* Save path to vhost in file while parsing in get_vhosts().

* Disable creating a new server block when no names match.

* Make parser select vhost based on information in the vhost it found previously, rather than searching again for a match.

* Make add_server_directives update the passed vhost

* Update boulder config to pass test

* Add testing code for the _do_for_subarray function

* documentation and formatting updates
2016-09-26 13:13:29 -07:00
Peter Eckersley
2434b4a549 Merge pull request #3507 from certbot/only-suggest-valid-names
Only suggest names LE will accept
2016-09-22 14:23:19 -07:00
Brad Warren
93a9e8c836 list 'staple-ocsp' as supported in nginx 2016-09-21 15:48:24 -07:00