Commit graph

73 commits

Author SHA1 Message Date
Brad Warren
4a259eda9c explain safe_copy 2020-07-27 15:59:32 -07:00
Brad Warren
be4467f38c expand mixin docs 2020-07-27 15:57:16 -07:00
Brad Warren
427faf70fe Prefetching is not supported with old cryptography 2020-07-10 12:35:34 -07:00
Brad Warren
b8211f81ba Use new OCSP interface. 2020-06-17 15:12:25 -07:00
Brad Warren
e7462fa2c5 Call save when removing cert. 2020-06-17 15:12:25 -07:00
Brad Warren
2d9ffa3a9c Remove warning.
If we hit this case, the cert is revoked and the error message we raise saying
this will be shown to the user higher up the stack.
2020-06-17 15:12:25 -07:00
Brad Warren
4d10e27a4d Use lineage.chain_path, not old chain_path. 2020-06-17 15:12:25 -07:00
Brad Warren
5ed5dfd927 preserve permissions 2020-06-17 15:12:25 -07:00
Brad Warren
84cc6825b6 Add clarifying comment. 2020-06-17 15:12:25 -07:00
Brad Warren
2567167f13 use default timeout 2020-06-17 15:12:25 -07:00
Brad Warren
01b2bfdc49 Check cert_path before using it. 2020-06-17 15:12:25 -07:00
Brad Warren
d946c2a08d accept args and kwargs 2020-06-17 15:12:25 -07:00
Brad Warren
eca207f658 document more exceptions 2020-06-17 15:12:25 -07:00
Brad Warren
5e58503b2d update docs 2020-06-17 15:12:25 -07:00
Brad Warren
e3b4c04e4c Merge branch 'ocsp-response' into bmw-ocsp-apache 2020-06-17 15:11:54 -07:00
alexzorin
d135e6140b
apache: handle statically linked mod_ssl (#8007)
In #7771, the Apache configurator gained the ability to identify what
version of OpenSSL Apache's ssl_module is linked against. However, the
detection was only functional if the module was built as a DSO (which is
almost always the case).

This commit covers the case where the ssl_module is statically linked
within the Apache binary. It requires the user to specify the path to
the binary (with --apache-bin) and emits a warning if static linking is
detected but no path has been provided.
2020-06-04 10:34:10 -07:00
ohemorange
3ea5170647
Error out earlier in apache installer when mod_ssl is not available (#7984)
* Error out in apache installer when mod_ssl is not available

* Update to MisconfigurationError and add/fix tests

* Remove error cases we no longer hit and associated test

* mock out function to have consistent error across machines

* improve changelog message

* only check key in modules list, not value
2020-05-19 15:34:21 -07:00
Joona Hoikkala
0976176a56
Temporary fix, REVERT 2020-04-30 01:29:52 +03:00
Joona Hoikkala
ae76f2d3b5
Fix the OCSP api call 2020-04-30 01:20:15 +03:00
Joona Hoikkala
839b86871d
Move cert_sha1_fingerprint to to internal apache_util 2020-04-22 20:56:48 +03:00
Joona Hoikkala
1e5d13f212
Implement deploy hook for ocsp prefetch functionality 2020-04-22 20:46:10 +03:00
Joona Hoikkala
2d9e9c8aef
Merge remote-tracking branch 'origin/master' into ocsp_apache_continued 2020-04-22 19:18:41 +03:00
Brad Warren
859dc38cb9
Consolidate cover envs and default to py3-cover (#7905)
* Consolidate cover envs and default to py3-cover

* use py38 for code coverage in Travis

* Disable coverage on Python < 3.6 line.
2020-04-16 08:59:40 -07:00
Joona Hoikkala
741278ef67
Use certificate file path as key for the internal storage and remove revoked and deleted certificates from pool when met 2020-04-16 00:50:19 +03:00
Karan Suthar
8e4dc0a48c
Minor bugfixes (#7891)
* Fix dangerous default argument

* Remove unused imports

* Remove unnecessary comprehension

* Use literal syntax to create data structure

* Use literal syntax instead of function calls to create data structure

Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
2020-04-13 10:41:39 -07:00
Joona Hoikkala
57cd0c7d81
Address review comments 2020-04-09 02:42:26 +03:00
m0namon
1285297b23
[Apache v2] Load apacheconfig tree and gate related tests (#7710)
* Load apacheconfig dependency, gate behind flag

* Bump apacheconfig dependency to latest version and install dev version of apache for coverage tests

* Move augeasnode_test tests to more generic parsernode_test

* Revert "Move augeasnode_test tests to more generic parsernode_test"

This reverts commit 6bb986ef78.

* Mock AugeasNode into DualNode's place, and run augeasnode tests exclusively on AugeasNode

* Don't calculate coverage for skeleton functions

* clean up helper function in augeasnode_test
2020-03-23 17:05:22 -07:00
ohemorange
9e3c348dff
Disable TLS session tickets in Apache (#7771)
Fixes #7350.

This PR changes the parsed modules from a `set` to a `dict`, with the filepath argument as the value. Accordingly, after calling `enable_mod` to enable `ssl_module`, modules now need to be re-parsed, so call `reset_modules`.

* Add mechanism for selecting apache config file, based on work done in #7191.

* Check OpenSSL version

* Remove os imports

* debian override still needs os

* Reformat remaining apache tests with modules dict syntax

* Clean up more apache tests

* Switch from property to method for openssl and add tests for coverage.

* Sometimes the dict location will be None in which case we should in fact return None

* warn thoroughly and consistently in openssl_version function

* update tests for new warnings

* read file as bytes, and factor out the open for testing

* normalize ssl_module_location path to account for being relative to server root

* Use byte literals in a python 2 and 3 compatible way

* string does need to be a literal

* patch builtins open

* add debug, remove space

* Add test to check if OpenSSL detection is working on different systems

* fix relative test location for cwd

* put </IfModule> on its own line in test case

* Revert test file to status in master.

* Call augeas load before reparsing modules to pick up the changes

* fix grep, tail, and mod_ssl location on centos

* strip the trailing whitespace from fedora

* just use LooseVersion in test

* call apache2ctl on debian systems

* Use sudo for apache2ctl command

* add check to make sure we're getting a version

* Add boolean so we don't warn on debian/ubuntu before trying to enable mod_ssl

* Reduce warnings while testing by setting mock _openssl_version.

* Make sure we're not throwing away any unwritten changes to the config

* test last warning case for coverage

* text changes for clarity
2020-03-23 16:49:52 -07:00
Brad Warren
06599a1e18
Cleanup more pylint issues (#7848)
This PR builds on #7657 and cleans up additional unnecessary pylint comments and some stray comments referring to pylint: disable comments that have been deleted that I didn't notice in my review of that PR.

* Remove stray pylint link.

* Cleanup more pylint comments

* Cleanup magic_typing imports

* Remove unneeded pylint: enable comments
2020-03-16 09:43:48 -07:00
Joona Hoikkala
895330e009
Use filesystem.replace for atomic move operations 2020-03-04 20:21:00 +02:00
m0namon
f169c37153
Merge pull request #7742 from osirisinferi/force-non-restrictive-umask
Force non restrictive umask when creating challenge directory in Apache plugin
2020-02-26 17:09:20 -08:00
Joona Hoikkala
dc255aeb4f
Fix tests and handle PluginError 2020-02-26 20:08:20 +02:00
Joona Hoikkala
b0feb33b9b
Fix the backup target path 2020-02-26 18:51:25 +02:00
Joona Hoikkala
a42cf70f71
More review comment fixes 2020-02-19 20:44:37 +02:00
Joona Hoikkala
d6dafb0a1b Merge branch 'ocsp_apache_continued' of github.com:certbot/certbot into ocsp_apache_continued 2020-02-19 18:07:58 +02:00
Joona Hoikkala
f192cbf12a
Address review comments 2020-02-19 18:07:30 +02:00
Joona Hoikkala
5a8032d5cc
Update certbot-apache/certbot_apache/_internal/prefetch_ocsp.py
Co-Authored-By: Brad Warren <bmw@users.noreply.github.com>
2020-02-19 18:04:30 +02:00
Brad Warren
42dda355c5
Correct AutoHSTS docs (#7767)
domains is a list of strings, not a single string.

* Correct AutoHSTS docs.

* Fix Apache enable_autohsts docs.
2020-02-18 14:54:07 -08:00
Adrien Ferrand
fc7e5e8e60
Remove useless pylint error suppression directives (#7657)
As pylint is evolving, it improves its accuracy, and several pylint error suppression (`# pylint: disable=ERROR) added in certbot codebase months or years ago are not needed anymore to make it happy.

There is a (disabled by default) pylint error to detect the useless suppressions (pylint-ception: `useless-suppression`). It is not working perfectly (it has also false-positives ...) but it is a good start to clean the codebase.

This PR removes several of these useless suppressions as detected by the current pylint version we use.

* Remove useless suppress

* Remove useless lines
2020-02-13 13:56:16 -08:00
Joona Hoikkala
a446e124e4
Fix tests after moving ocsp to public api 2020-02-12 17:55:10 +02:00
Joona Hoikkala
8ddc17fd2c
Merge remote-tracking branch 'origin/master' into ocsp_apache_continued 2020-02-12 17:42:41 +02:00
OsirisInferi
d3a4b8fd8c
Missing import 2020-02-05 22:27:12 +01:00
OsirisInferi
f3ed133744
Wrap makedirs() within exception handelrs 2020-02-05 22:17:29 +01:00
Joona Hoikkala
caf2ad2cb1
Add overview documentation of the functionality to .py 2020-02-05 17:00:08 +02:00
Joona Hoikkala
17af868f62
Update certbot-apache/certbot_apache/_internal/apache_util.py
Co-Authored-By: Brad Warren <bmw@users.noreply.github.com>
2020-02-04 22:04:01 +02:00
Joona Hoikkala
4b3dea8be6
Update certbot-apache/certbot_apache/_internal/configurator.py
Co-Authored-By: Brad Warren <bmw@users.noreply.github.com>
2020-02-04 21:58:42 +02:00
OsirisInferi
86926dff92
Use unrestrictive umask for challenge directory 2020-02-04 19:27:27 +01:00
Joona Hoikkala
6395cc2b48
Copy dbm file to work directory before writing 2020-02-04 20:13:28 +02:00
Joona Hoikkala
1ad23f9db0
Move DBM handling to a context manager 2020-02-04 13:13:04 +02:00
Joona Hoikkala
fd74aba422
Address review comments 2020-02-03 22:18:52 +02:00