Support for standalone client challenge solvers.

class acme.standalone.TLSServer(*args: Any, **kwargs: Any)[source]

Generic TLS Server.

server_bind() None[source]

Called by constructor to bind the socket.

May be overridden.

class acme.standalone.ACMEServerMixin[source]

ACME server common settings mixin.

class acme.standalone.BaseDualNetworkedServers(ServerClass: Type[TCPServer], server_address: Tuple[str, int], *remaining_args: Any, **kwargs: Any)[source]

Base class for a pair of IPv6 and IPv4 servers that tries to do everything it’s asked for both servers, but where failures in one server don’t affect the other.

If two servers are instantiated, they will serve on the same port.

serve_forever() None[source]

Wraps socketserver.TCPServer.serve_forever

getsocknames() List[Tuple[str, int]][source]

Wraps socketserver.TCPServer.socket.getsockname

shutdown_and_server_close() None[source]

Wraps socketserver.TCPServer.shutdown, socketserver.TCPServer.server_close, and threading.Thread.join

class acme.standalone.TLSALPN01Server(server_address: Tuple[str, int], certs: List[Tuple[PKey, X509]], challenge_certs: Mapping[bytes, Tuple[PKey, X509]], ipv6: bool = False)[source]

TLSALPN01 Server.

class acme.standalone.HTTPServer(*args: Any, **kwargs: Any)[source]

Generic HTTP Server.

class acme.standalone.HTTP01Server(server_address: Tuple[str, int], resources: Set[HTTP01], ipv6: bool = False, timeout: int = 30)[source]

HTTP01 Server.

class acme.standalone.HTTP01DualNetworkedServers(*args: Any, **kwargs: Any)[source]

HTTP01Server Wrapper. Tries everything for both. Failures for one don’t affect the other.

class acme.standalone.HTTP01RequestHandler(*args: Any, **kwargs: Any)[source]

HTTP01 challenge handler.

Adheres to the stdlib’s socketserver.BaseRequestHandler interface.


simple_http_resources (set) – A set of HTTP01Resource objects. TODO: better name?

class HTTP01Resource(chall, response, validation)

Alias for field number 0


Alias for field number 1


Alias for field number 2

property timeout: int

The default timeout this server should apply to requests. :return: timeout to apply :rtype: int

log_message(format: str, *args: Any) None[source]

Log arbitrary message.

handle() None[source]

Handle request.

handle_index() None[source]

Handle index page.

handle_404() None[source]

Handler 404 Not Found errors.

handle_simple_http_resource() None[source]

Handle HTTP01 provisioned resources.

classmethod partial_init(simple_http_resources: Set[HTTP01], timeout: int) partial[HTTP01RequestHandler][source]

Partially initialize this handler.

This is useful because socketserver.BaseServer takes uninitialized handler and initializes it with the current request.