-
Notifications
You must be signed in to change notification settings - Fork 318
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5067 from jtschladen/convert-csr-to-string
Convert CSR to string
- Loading branch information
Showing
3 changed files
with
18 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,27 +7,26 @@ | |
.. moduleauthor:: Mathias Petermann <[email protected]> | ||
""" | ||
from datetime import datetime, timedelta | ||
import json | ||
from datetime import datetime, timedelta | ||
|
||
from acme import challenges | ||
from acme.errors import WildcardUnsupportedError | ||
from acme.messages import errors, STATUS_VALID, ERROR_CODES | ||
from botocore.exceptions import ClientError | ||
from flask import current_app | ||
from retrying import retry | ||
from sentry_sdk import capture_exception | ||
|
||
from lemur.authorizations import service as authorization_service | ||
from lemur.common.utils import drop_last_cert_from_chain, csr_to_string | ||
from lemur.constants import ACME_ADDITIONAL_ATTEMPTS | ||
from lemur.common.utils import drop_last_cert_from_chain | ||
from lemur.destinations import service as destination_service | ||
from lemur.exceptions import LemurException, InvalidConfiguration | ||
from lemur.extensions import metrics | ||
from lemur.plugins.base import plugins | ||
from lemur.destinations import service as destination_service | ||
from lemur.plugins.lemur_acme.acme_handlers import AcmeHandler, AcmeDnsHandler | ||
|
||
from retrying import retry | ||
|
||
|
||
class AcmeChallengeMissmatchError(LemurException): | ||
pass | ||
|
@@ -86,7 +85,7 @@ def create_certificate(self, csr, issuer_options): | |
authority = issuer_options.get("authority") | ||
acme_client, registration = self.acme.setup_acme_client(authority) | ||
|
||
orderr = acme_client.new_order(csr) | ||
orderr = acme_client.new_order(csr_to_string(csr)) | ||
|
||
chall = [] | ||
deployed_challenges = [] | ||
|
@@ -266,7 +265,7 @@ def create_certificate(self, csr, issuer_options): | |
@retry(stop_max_attempt_number=ACME_ADDITIONAL_ATTEMPTS, wait_fixed=5000) | ||
def create_certificate_immediately(self, acme_client, order_info, csr): | ||
try: | ||
order = acme_client.new_order(csr) | ||
order = acme_client.new_order(csr_to_string(csr)) | ||
except WildcardUnsupportedError: | ||
metrics.send("create_certificte_immediately_wildcard_unsupported", "counter", 1) | ||
raise Exception( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters