2014-11-21 13:10:33 -05:00
|
|
|
"""Let's Encrypt client errors."""
|
|
|
|
|
|
|
|
|
|
|
2015-06-12 10:10:39 -04:00
|
|
|
class Error(Exception):
|
2014-11-21 13:10:33 -05:00
|
|
|
"""Generic Let's Encrypt client error."""
|
2014-11-29 19:05:18 -05:00
|
|
|
|
|
|
|
|
|
Rewrite acccounts and registration.
Save accounts to:
/etc/letsencrypt/accounts/www.letsencrypt-dmeo.org/acme/new-reg/ \
kuba.le.wtf@2015-07-04T14:04:10Z/ \
{regr.json,meta.json,private_key.json}
Account now represents a combination of private key, Registration
Resource and client account metadata. `Account.id` based on the
account metadata (creation host and datetime). UI interface
(`cli._determine_account`) based on the `id`, and not on email as
previously.
Add `AccountStorage` interface and `AccountFileStorage`,
`AccountMemoryStorage` implementations (latter, in-memory, useful for
testing).
Create Account only after Registration Resource is received
(`register()` returns `Account`).
Allow `client.Client(..., acme=acme, ...)`: API client might reuse
acme.client.Client as returned by `register()`.
Move report_new_account to letsencrypt.account, client.Client.register
into client.register.
Use Registration.from_data acme API.
achallenges.AChallenge.key is now the `acme.jose.JWK`, not
`le_util.Key`. Plugins have to export PEM/DER as necessary
(c.f. `letsencrypt.plugins.common.Dvsni.get_key_path`)
Add --agree-tos, save --agree-eula to "args.eula". Prompt for EULA as
soon as client is launched, add prompt for TOS.
Remove unnecessary letsencrypt.network. Remove, now irrelevant,
`IConfig.account_keys_dir`.
Based on the draft from
https://github.com/letsencrypt/letsencrypt/pull/362#issuecomment-97946817.
2015-07-04 02:46:36 -04:00
|
|
|
class AccountStorageError(Error):
|
|
|
|
|
"""Generic `.AccountStorage` error."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AccountNotFound(AccountStorageError):
|
|
|
|
|
"""Account not found error."""
|
|
|
|
|
|
|
|
|
|
|
2015-06-12 10:10:39 -04:00
|
|
|
class ReverterError(Error):
|
2015-01-19 06:15:31 -05:00
|
|
|
"""Let's Encrypt Reverter error."""
|
|
|
|
|
|
|
|
|
|
|
2015-08-04 17:45:03 -04:00
|
|
|
class SubprocessError(Error):
|
|
|
|
|
"""Subprocess handling error."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CertStorageError(Error):
|
|
|
|
|
"""Generic `.CertStorage` error."""
|
|
|
|
|
|
2015-10-21 01:24:58 -04:00
|
|
|
|
2015-01-29 22:35:31 -05:00
|
|
|
# Auth Handler Errors
|
2015-06-12 10:10:39 -04:00
|
|
|
class AuthorizationError(Error):
|
2015-04-13 20:33:11 -04:00
|
|
|
"""Authorization error."""
|
2015-01-10 08:19:22 -05:00
|
|
|
|
|
|
|
|
|
2015-06-23 16:10:20 -04:00
|
|
|
class FailedChallenges(AuthorizationError):
|
|
|
|
|
"""Failed challenges error.
|
|
|
|
|
|
|
|
|
|
:ivar set failed_achalls: Failed `.AnnotatedChallenge` instances.
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
def __init__(self, failed_achalls):
|
|
|
|
|
assert failed_achalls
|
|
|
|
|
self.failed_achalls = failed_achalls
|
|
|
|
|
super(FailedChallenges, self).__init__()
|
|
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
|
return "Failed authorization procedure. {0}".format(
|
|
|
|
|
", ".join(
|
|
|
|
|
"{0} ({1}): {2}".format(achall.domain, achall.typ, achall.error)
|
|
|
|
|
for achall in self.failed_achalls if achall.error is not None))
|
|
|
|
|
|
|
|
|
|
|
2015-06-12 10:10:39 -04:00
|
|
|
class ContAuthError(AuthorizationError):
|
2015-04-13 20:33:11 -04:00
|
|
|
"""Let's Encrypt Continuity Authenticator error."""
|
2015-01-10 08:19:22 -05:00
|
|
|
|
|
|
|
|
|
2015-06-12 10:10:39 -04:00
|
|
|
class DvAuthError(AuthorizationError):
|
2015-01-29 22:35:31 -05:00
|
|
|
"""Let's Encrypt DV Authenticator error."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Authenticator - Challenge specific errors
|
2015-06-12 10:10:39 -04:00
|
|
|
class DvsniError(DvAuthError):
|
2015-01-29 22:35:31 -05:00
|
|
|
"""Let's Encrypt DVSNI error."""
|
|
|
|
|
|
|
|
|
|
|
2015-06-26 12:29:40 -04:00
|
|
|
# Plugin Errors
|
|
|
|
|
class PluginError(Error):
|
|
|
|
|
"""Let's Encrypt Plugin error."""
|
2014-12-03 07:31:01 -05:00
|
|
|
|
2015-10-21 01:24:58 -04:00
|
|
|
|
2015-10-19 15:03:11 -04:00
|
|
|
class PluginSelectionError(Error):
|
|
|
|
|
"""A problem with plugin/configurator selection or setup"""
|
2014-12-03 07:31:01 -05:00
|
|
|
|
2015-10-21 01:24:58 -04:00
|
|
|
|
2015-06-26 12:29:40 -04:00
|
|
|
class NoInstallationError(PluginError):
|
2015-01-24 05:15:23 -05:00
|
|
|
"""Let's Encrypt No Installation error."""
|
|
|
|
|
|
|
|
|
|
|
2015-06-26 12:29:40 -04:00
|
|
|
class MisconfigurationError(PluginError):
|
2015-01-24 05:15:23 -05:00
|
|
|
"""Let's Encrypt Misconfiguration error."""
|
2015-01-19 06:15:31 -05:00
|
|
|
|
2015-09-06 05:20:11 -04:00
|
|
|
|
2015-07-24 06:22:35 -04:00
|
|
|
class NotSupportedError(PluginError):
|
|
|
|
|
"""Let's Encrypt Plugin function not supported error."""
|
|
|
|
|
|
2015-02-09 04:43:54 -05:00
|
|
|
|
2015-06-12 10:10:39 -04:00
|
|
|
class RevokerError(Error):
|
2015-02-09 05:47:45 -05:00
|
|
|
"""Let's Encrypt Revoker error."""
|
2015-09-26 12:47:29 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class StandaloneBindError(Error):
|
|
|
|
|
"""Standalone plugin bind error."""
|
|
|
|
|
|
|
|
|
|
def __init__(self, socket_error, port):
|
|
|
|
|
super(StandaloneBindError, self).__init__(
|
|
|
|
|
"Problem binding to port {0}: {1}".format(port, socket_error))
|
|
|
|
|
self.socket_error = socket_error
|
|
|
|
|
self.port = port
|