Skip to content
This repository was archived by the owner on Jul 7, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/production/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -488,11 +488,11 @@ before requesting that LetsEncrypt finalize the certificate request and send us

.. figure:: letsencrypt_flow.png

To start issuing certificates through LetsEncrypt, you must enable Celery support within Lemur first[*]_. After doing so,
To start issuing certificates through LetsEncrypt, you must enable Celery support within Lemur first [1]_. After doing so,
you need to create a LetsEncrypt authority. To do this, visit
Authorities -> Create. Set the applicable attributes and click "More Options".

.. [*] It is possible to use synchronous certificate creation without Celery by supplying the ``create_immediately`` parameter in your certificate creation requests, but this is only recommended for testing and development purposes, given the inherent `limitations of DNS record propagation <https://letsencrypt.org/docs/challenge-types/#dns-01-challenge>`.
.. [1] It is possible to use synchronous certificate creation without Celery by supplying the ``create_immediately`` parameter in your certificate creation requests, but this is only recommended for testing and development purposes, given the inherent `limitations of DNS record propagation <https://letsencrypt.org/docs/challenge-types/#dns-01-challenge>`__.

.. figure:: letsencrypt_authority_1.png

Expand Down
2 changes: 1 addition & 1 deletion lemur/plugins/lemur_acme/cloudflare.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import time

import CloudFlare
import cloudflare as CloudFlare
from flask import current_app


Expand Down
49 changes: 32 additions & 17 deletions lemur/plugins/lemur_acme/tests/test_acme_dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,29 +186,44 @@ def test_complete_dns_challenge_fail(
with self.assertRaises(ValueError):
self.acme.complete_dns_challenge(mock_acme, mock_authz)

@patch("acme.client.ClientV2")
@patch("OpenSSL.crypto", return_value="mock_cert")
@patch("josepy.util.ComparableX509")
@patch("lemur.plugins.lemur_acme.plugin.AcmeDnsHandler.get_dns_challenges")
@patch("lemur.plugins.lemur_acme.acme_handlers.OpenSSL.crypto.dump_certificate")
@patch("lemur.plugins.lemur_acme.acme_handlers.OpenSSL.crypto.load_certificate")
def test_request_certificate(
self,
mock_get_dns_challenges,
mock_jose,
mock_crypto,
mock_acme,
mock_load_certificate,
mock_dump_certificate,
):
mock_cert_response = Mock()
mock_cert_response.body = "123"
mock_cert_response_full = [mock_cert_response, True]
mock_acme.poll_and_request_issuance = Mock(return_value=mock_cert_response_full)
# Mock the acme client
mock_acme_client = Mock()
mock_acme_client.poll = Mock(return_value=(Mock(), Mock()))

# Mock the order and its finalization
mock_order = Mock()
mock_order.uri = "https://test.com/order/123"
mock_finalized_order = Mock()
mock_finalized_order.fullchain_pem = "mock_fullchain_pem"
mock_finalized_order.alternative_fullchains_pem = []
mock_finalized_order.authorizations = []

mock_acme_client.poll_authorizations = Mock(return_value=mock_order)
mock_acme_client.finalize_order = Mock(return_value=mock_finalized_order)
mock_acme_client.net.account.uri = "https://test.com/account/123"

# Mock crypto operations
mock_dump_certificate.return_value = b"mock_certificate"
mock_load_certificate.return_value = Mock()

# Mock authorizations
mock_authz = []
mock_authz_record = MagicMock()
mock_authz_record.authz = Mock()
mock_authz_record.authz = [Mock()]
mock_authz.append(mock_authz_record)
mock_acme.fetch_chain = Mock(return_value="mock_chain")
mock_crypto.dump_certificate = Mock(return_value=b"chain")
mock_order = Mock()
self.acme.request_certificate(mock_acme, [], mock_order)

result = self.acme.request_certificate(mock_acme_client, mock_authz, mock_order)

# Verify the result is a tuple of (certificate, chain)
self.assertIsInstance(result, tuple)
self.assertEqual(len(result), 2)

def test_setup_acme_client_fail(self):
mock_authority = Mock()
Expand Down
1 change: 0 additions & 1 deletion lemur/plugins/lemur_verisign/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ def handle_response(content):
:return: :raise Exception:
"""
d = xmltodict.parse(content)
global VERISIGN_ERRORS
if d.get("Error"):
status_code = d["Error"]["StatusCode"]
elif d.get("Response"):
Expand Down
Loading