Commit Graph
2125 Commits
Author SHA1 Message Date
Felix YanandBrad Warren 4866e9fe61 Fix a typo: syncronization -> synchronization (#4826) 2017-06-12 08:20:51 -07:00
Andrew IttnerandBrad Warren cafd4802b7 Add more useful usage instructions for all subcommands (#4710)
* Add more useful usage instructions for all subcommands

Fixes #3875.

* Update usage instructions

Address PR comments.  Fixes #3875.

* Fix line length

* Suffix usage lines with two empty lines

Per review, this brackets all usage text in 2 newlines to match existing
text.
2017-06-12 08:12:41 -07:00
Johannes KeyserandBrad Warren 498f8ad75c Add AAAA record check suggestion (#4824) 2017-06-12 07:40:56 -07:00
Brad Warren 2ebd8e9763 Add trailing space to prompt. 2017-06-09 10:50:21 -07:00
Brad Warren 1871f0d1b9 Deduplicate code using textwrap.fill. 2017-06-09 10:46:51 -07:00
Jacob Hoffman-AndrewsandBrad Warren cd34c4272d Improve text of manual plugin. (#4810) 2017-06-09 10:09:45 -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
ohemorangeandGitHub 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
Zach ShepherdandBrad Warren af8dae6cb2 Check domains for accidental inclusion of a scheme (#4788)
Currently, accidentally including a scheme with the domain name does not
produce a particularly helpful error message.

Examples without this change:
1. `certbot certonly -d https://test.example.com --webroot`:

Saving debug log to /tmp/certbot/logs/letsencrypt.log
Obtaining a new certificate
An unexpected error occurred:
The request message was malformed :: Error creating new authz :: Invalid character in DNS name
Please see the logfiles in /tmp/certbot/logs for more details.

2. `certbot certonly -d http://hoeveelmensengaveneeneuroomtezienhoeveelmenseneeneurogaven.example.com`

Requested domain http://hoeveelmensengaveneeneuroomtezienhoeveelmenseneeneurogaven.example.com is not a FQDN because label http://hoeveelmensengaveneeneuroomtezienhoeveelmenseneeneurogaven is too long.

Examples with this change:
1. `certbot certonly -d https://test.example.com --webroot`:

Requested name https://test.example.com appears to be a URL, not a FQDN. Try again without the leading "https://".

2. `certbot certonly -d http://hoeveelmensengaveneeneuroomtezienhoeveelmenseneeneurogaven.example.com`

Requested name http://hoeveelmensengaveneeneuroomtezienhoeveelmenseneeneurogaven.example.com appears to be a URL, not a FQDN. Try again without the leading "http://".

(Resolves #4785)
2017-06-06 15:51:16 -07:00
Zach ShepherdandBrad Warren e749937465 route53: rename to match other DNS plugins (#4747)
This change renames certbot-route53 to certbot-dns-route53 and updates
the package's setup.py file to maintain backwards compatibility.

Testing Done:
 * Run `certbot` with `-a certbot-route53:auth`, verify the plugin runs.
 * Run `certbot` with `--dns-route53`, verify the plugin runs.
2017-06-06 15:41:04 -07:00
Brad WarrenandGitHub 89e63eaf84 Use certificate in NS1 plugin flag's help. (#4783) 2017-06-05 18:21:47 -07:00
Brad WarrenandGitHub ee70799c62 Get full test coverage on certbot.plugins.common. (#4765)
Addresses final review comments on #4720.
2017-06-01 10:55:42 -07:00
Brad WarrenandGitHub 738732a0db Improve bad preferred challenge error message. (#4761)
Using ArgumentTypeError causes Certbot to report an unexpected error occurred
while using ArgumentError causes argparse to print more usage information and
call sys.exit().
2017-06-01 10:42:34 -07:00
ohemorangeandBrad Warren 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
Yen Chi HsuanandBrad Warren c9e9879ad9 Enable unit tests on OS X (#4697)
* Add OS X test

* Fix apache tests

* Use absolute path first so that certbot works with non-standard $PATH

Some tests use a fake $PATH, which prevents invoking `sw_vers`

* Also test Python 3 on Mac

* Set ulimit to fix "Too many open files"
2017-06-01 09:03:54 -07:00
Jeff R. AllenandBrad Warren 6f98987c12 Added options to set the listen address for standalone mode (#4694)
Fixes #255.
2017-06-01 09:02:14 -07:00
yomnaandBrad Warren d7f9859c3f [#3866]: "certbot certificates" checks validity with OpenSSL (#4155)
* cert signature validation for certificates subcommand + a test

* refactoring validation + adding in a check for making sure that the private key matches the certificate

* adding testing certs

* assertIsNone(x) -> assertEqual(None,x) to unbreak the py2.6 tests

* modifying test_verifu_renewable_cert_failure to hopefully appease python 3 test timeouts

* updating cryptography to be >=1.2 so that we can use verify

* removing unused, old testing certificate

* adding better error handling/logging

* adding test for IOError

* switching to a 2048 bit rsa key
2017-05-31 15:04:41 -07:00
Noah SwartzandGitHub e02245a59f Merge pull request #4560 from certbot/issue_4519
update cert to certificate
2017-05-31 13:48:43 -07:00
Andrew IttnerandZach Shepherd ed23290232 Clean up Sphinx errors (#4706)
Also minor copyedits, suppress unhelpful errors, mark files that should
*not* be in the TOC as hidden.
2017-05-26 20:57:14 -07:00
Brad WarrenandGitHub 7fde26a7b4 Merge branch 'master' into issue_4519 2017-05-26 15:56:26 -07:00
Zach ShepherdandBrad Warren c827c9ec5f NS1 DNS Authenticator (#4602)
Implement an Authenticator which can fulfill a dns-01 challenge using
the NS1 DNS API. Applicable only for domains using NS1 DNS.

Testing Done:
 * `tox -e py27`
 * `tox -e lint`
 * Manual testing:
    * Used `certbot certonly --dns-nsone -d`, specifying a
      credentials file as a command line argument. Verified that a
      certificate was successfully obtained without user interaction.
    * Used `certbot certonly --dns-nsone -d`, without specifying a
      credentials file as a command line argument. Verified that the
      user was prompted and that a certificate was successfully
      obtained.
    * Used `certbot certonly -d`. Verified that the user was prompted for
      a credentials file after selecting dnsimple interactively and that
      a certificate was successfully obtained.
    * Used `certbot renew --force-renewal`. Verified that certificates
      were renewed without user interaction.
 * Negative testing:
    * Path to non-existent credentials file.
    * Credentials file with unsafe permissions (644).
    * Path to credentials file with an invalid token.
    * Path to credentials file without a token.
    * Domain name not registered to NS1 account.
2017-05-26 11:24:38 -07:00
Nicholas TaitandBrad Warren 4cbdea6ccb Improve warning message to user after an operation is canceled (#4723)
Fixes #4134
2017-05-25 16:29:19 -07:00
Brad WarrenandGitHub 93310fe67c Fixes #4719 (#4737)
* Automatically delete temp log file when not used.

This allows close() calls in logging.shutdown() to cause the file to be
deleted when no logging output has been written to the file.

* Make certbot.log.MemoryHandler.flush() a noop.

This causes MemoryHandler.flush() calls in logging.shutdown to be a noop,
allowing us to control when the handler is actually flushed. This prevents log
records from being sent to a temporary file handler for things like
`certbot --version`.

* Keep reference to certbot.log.MemoryHandler.target

In Python 2.7+, the logging module only keeps weak references to created
logging handlers. Because of this, the MemoryHandler's target will not be
properly flushed and closed when logging.shutdown() is called on program exit
unless we keep a reference to it in the MemoryHandler.

* Fixes #4719.

This completes the changes necessary to fix #4719. Now temporary log files are
not created if sys.exit() is called before logging is fully set up. These files
are still created if Certbot crashes for any other reason.

* Document pre_arg_parse_except_hook args.
2017-05-25 12:16:05 -07:00
Noah Swartz 1670bfb152 fix tests 2017-05-24 14:56:12 -07:00
Noah Swartz f59eb8e630 fix linting issues 2017-05-24 13:06:12 -07:00
Noah Swartz 7edb877ae8 merge with latest master 2017-05-24 12:32:06 -07:00
Anna LiaoandBrad Warren 8ae3a9082d updated manual challenge prompt so last sentence is complete (#4704)
Fixes #4641.
2017-05-24 11:50:37 -07:00
ohemorangeandBrad Warren 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
Zach ShepherdandBrad Warren fb02877268 DNSimple DNS Authenticator (#4587)
Implement an Authenticator which can fulfill a dns-01 challenge using
the DNSimple DNS API. Applicable only for domains using DNSimple DNS.

Testing Done:
 * `tox -e py27`
 * `tox -e lint`
 * Manual testing:
    * Used `certbot certonly --dns-dnsimple -d`, specifying a
      credentials file as a command line argument. Verified that a
      certificate was successfully obtained without user interaction.
    * Used `certbot certonly --dns-dnsimple -d`, without specifying a
      credentials file as a command line argument. Verified that the
      user was prompted and that a certificate was successfully
      obtained.
    * Used `certbot certonly -d`. Verified that the user was prompted for
      a credentials file after selecting dnsimple interactively and that
      a certificate was successfully obtained.
    * Used `certbot renew --force-renewal`. Verified that certificates
      were renewed without user interaction.
 * Negative testing:
    * Path to non-existent credentials file.
    * Credentials file with unsafe permissions (644).
    * Path to credentials file with an invalid token.
    * Path to credentials file without a token.
    * Domain name not registered to DNSimple account.
2017-05-22 17:06:04 -07:00
Aaron CohenandBrad Warren 42c0117c16 Domain change wording (#4709)
* Change wording of renew with new domains msg to allow clearer display.

* Further improve domain change message formatting.

* Fix text formatting tests
2017-05-22 14:43:08 -07:00
FabianandBrad Warren 2680879068 Print stdout when running a hook (#4167, #4487) (#4702) 2017-05-22 13:00:44 -07:00
Brad WarrenandGitHub c2b24702b7 Fix defaults on older systems (#4691)
* Creates SupportedChallengesAction

This fixes #3987 as the call to set_by_default can be removed entirely.
Additionally, logger.warning can be used rather than writing to stderr directly
because #3184 has been resolved and we're guaranteed to having logging setup.

* Move validator to SupportedChallengesAction

supported_challenges_validator was moved to SupportedChallengesAction so
argparse.ArgumentError can be easily used to provide nice error output. Tests
in standalone_test.py were also updated so the module still has 100% test
coverage.

* Better document ArgumentError usage
2017-05-19 16:26:15 -07:00
Zach ShepherdandBrad Warren 49c41da4f1 CloudXNS DNS Authenticator (#4585)
Implement an Authenticator which can fulfill a dns-01 challenge using
the CloudXNS DNS API. Applicable only for domains using CloudXNS DNS.

Testing Done:
 * `tox -e py27`
 * `tox -e lint`
 * Manual testing:
    * Used `certbot certonly --dns-cloudxns -d`, specifying a
      credentials file as a command line argument. Verified that a
      certificate was successfully obtained without user interaction.
    * Used `certbot certonly --dns-cloudxns -d`, without specifying a
      credentials file as a command line argument. Verified that the
      user was prompted and that a certificate was successfully
      obtained.
    * Used `certbot certonly -d`. Verified that the user was prompted for
      a credentials file after selecting cloudxns interactively and that
      a certificate was successfully obtained.
    * Used `certbot renew --force-renewal`. Verified that certificates
      were renewed without user interaction.
 * Negative testing:
    * Path to non-existent credentials file.
    * Credentials file with unsafe permissions (644).
    * Domain name not registered to CloudXNS account.
2017-05-19 16:23:53 -07:00
Jeff R. AllenandBrad Warren bbbfc473d3 Handle mixed case domains in CSRs (#4685)
Lowercase domains from CSR, just like the domains from the
command line are.

Fixes #4684
2017-05-19 13:54:00 -07:00
Zach ShepherdandBrad Warren 7da5381968 Common code for Lexicon-based DNS authenticators (#4583)
Introduce abstract classes to provide base functionality for Lexicon-based DNS Authenticator plugins and corresponding test cases.
2017-05-18 14:05:47 -07:00
Brad WarrenandGitHub 462c0aba62 Modify special action types only once (#4656) 2017-05-17 14:25:50 -07:00
Zach ShepherdandBrad Warren 4caff11371 Google Cloud DNS Authenticator (#4581)
Implement an Authenticator which can fulfill a dns-01 challenge using
the Google Cloud DNS API. Applicable only for domains using Google Cloud
DNS for DNS.

Testing Done:
 * `tox -e py27`
 * `tox -e lint`
 * Manual testing:
    * Used `certbot certonly --dns-google -d`, specifying a credentials
      file as a command line argument. Verified that a certificate was
      successfully obtained without user interaction.
    * Used `certbot certonly --dns-google -d`, without specifying a
      credentials file as a command line argument. Verified that the
      user was prompted and that a certificate was successfully
      obtained.
    * Used `certbot certonly -d`. Verified that the user was prompted for
      a credentials file after selecting google interactively and that
      a certificate was successfully obtained.
    * Used `certbot renew --force-renewal`. Verified that certificates
      were renewed without user interaction.
 * Negative testing:
    * Path to non-existent credentials file.
    * Credentials file with unsafe permissions (644).
    * Domain name not registered to Google Cloud Platform account.
2017-05-17 11:26:26 -07:00
Brad Warren d467295d2a Make 42d07d7 more closely follow repo conventions 2017-05-15 15:01:54 -07:00
Ryan Pineo 42d07d756d support version 0.12.0 of configargparse
fixes #4648
2017-05-12 20:18:27 -04:00
Zach Shepherd 9e206f8024 DigitalOcean DNS Authenticator
Implement an Authenticator which can fulfill a dns-01 challenge using the
DigitalOcean API. Applicable only for domains using DigitalOcean for DNS.

Testing Done:
 * `tox -e py27`
 * `tox -e lint`
 * Manual testing:
    * Used `certbot certonly --dns-digitalocean -d`, specifying a
      credentials file as a command line argument. Verified that a
      certificate was successfully obtained without user interaction.
    * Used `certbot certonly --dns-digitalocean -d`, without specifying a
      credentials file as a command line argument. Verified that the user
      was prompted and that a certificate was successfully obtained.
    * Used `certbot certonly -d`. Verified that the user was prompted for
      a credentials file after selecting digitalocean interactively and
      that a certificate was successfully obtained.
    * Used `certbot renew --force-renewal`. Verified that certificates
      were renewed without user interaction.
 * Negative testing:
    * Path to non-existent credentials file.
    * Credentials file with unsafe permissions (644).
    * Credentials file missing token.
    * Credentials file with blank token.
    * Credentials file with incorrect token.
    * Domain name not registered to DigitalOcean account.
2017-05-11 17:26:02 -07:00
Zach ShepherdandBrad Warren 71451dd54b security: preserve permissions on renewal conf (#4430)
Ensure that permissions are preserved when renewal data is written to
conf files. This allows users to limit access to the file, if they wish.

Testing done:
 * `tox -e py27`
 * `tox -e lint`
 * Manual Testing
    * Got a new certificate. Restricted the permissions on the renewal
      conf. Renewed the certificate. Verified that the new renewal conf
      permissions matched.
2017-05-11 15:49:34 -07:00
Zach Shepherd db6defe614 Cloudflare DNS Authenticator
Implement an Authenticator which can fulfill a dns-01 challenge using the
Cloudflare API. Applicable only for domains using Cloudflare for DNS.

Testing Done:
 * `tox -e py27`
 * `tox -e lint`
 * Manual testing:
    * Used `certbot certonly --dns-cloudflare -d`, specifying a
      credentials file as a command line argument. Verified that a
      certificate was successfully obtained without user interaction.
    * Used `certbot certonly --dns-cloudflare -d`, without specifying a
      credentials file as a command line argument. Verified that the user
      was prompted and that a certificate was successfully obtained.
    * Used `certbot certonly -d`. Verified that the user was prompted for
      a credentials file after selecting cloudflare interactively and
      that a certificate was successfully obtained.
    * Used `certbot renew --force-renewal`. Verified that certificates
      were renewed without user interaction.
 * Negative testing:
    * Path to non-existent credentials file.
    * Credentials file with unsafe permissions (644).
    * Credentials file missing e-mail address.
    * Credentials file with blank API key.
    * Credentials file with incorrect e-mail address.
    * Credentials file with malformed API key.
    * Credentials file with invalid API key.
    * Domain name not registered to Cloudflare account.
2017-05-10 15:26:51 -07:00
Yen Chi HsuanandBrad Warren c6fcb017b8 Use universal_newlines=True whereever the output is used (#4626) 2017-05-08 10:55:02 -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 WarrenandGitHub 0db668f67b remove unnecessary closes causing logging problems (#4616) 2017-05-04 16:35:37 -07:00
Brad WarrenandGitHub 13c88f1c02 Properly handle EOF in input (#4612)
* properly handle eof

* cleanup InputWithTimeoutTest

* add test_eof

* add comment about mimicking getpass
2017-05-03 14:44:15 -07:00
Brad WarrenandGitHub 83064941bc Merge pull request #4607 from certbot/joohoi_multiple_vhosts2
Multiple vhosts 2
2017-05-02 17:55:38 -07:00
Noah SwartzandBrad Warren f57f35b1dd Start work on multivhost support in Apache
* get through parsing

* not slice

* add mult vhost per file

* idx line backwards

* blocks be wrong

* always close ifmod

* let's not mess up indexes

* don't double add multi

* fix some lint, only dedupe multi

* tests

* fix lint

* in progress bit flip

* try to pick the right vhost

* take Dominic's suggestion

* don't redo search

* add ancestor

* we now support multiple vhosts

* yay

* add docstrings
2017-05-02 15:38:27 -07:00