package letsencrypt-mirage
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=8effc2c49161a9be28b82ec2bd83171e15519a0a5d94c3c8c0f60f00cb7b06db
sha512=ea2b8deabdbd51ec4c3e7124a8054be6bd68eabfe8767a2d34c0e8da1a0812b72bb606053424e6940cf93ef1a29eec9a1a60a7d76d9955d78f9aeaa658e935cc
doc/letsencrypt-mirage.http-server/LE_http_server/Make/index.html
Module LE_http_server.MakeSource
Parameters
module Stack : Tcpip.Stack.V4V6Signature
val get_certificates :
yes_my_port_80_is_reachable_and_unused:Stack.t ->
production:bool ->
LE.configuration ->
Http_mirage_client.t ->
(Tls.Config.own_cert, [> `Msg of string | `HTTP of LE.Client.error ]) result
Lwt.tget_certificates ~yes_my_port_80_is_reachable_and_unused ~production cfg client tries to resolve the Let's encrypt challenge by initiating an HTTP server on port 80 and handling requests from it with ocaml-letsencrypt.
This resolution requires that your domain name (requested in the given cfg.hostname) redirects Let's encrypt to this HTTP server. You probably need to check your DNS configuration.
The client value can be made by Http_mirage_client.Make.connect to be able to launch HTTP requests to Let's encrypt.
val with_lets_encrypt_certificates :
?port:int ->
?alpn_protocols:string list ->
Stack.t ->
production:bool ->
LE.configuration ->
Http_mirage_client.t ->
(Paf.TLS.flow, Ipaddr.t * int) Alpn.server_handler ->
(unit, [> `Msg of string | `HTTP of LE.Client.error ]) result Lwt.twith_lets_encrypt_certificates ?port ?alpn_protocols stackv4v6 ~production cfg client handler launches 2 servers:
- An HTTP/1.1 server which handles let's encrypt challenges and redirections
- An ALPN server (which handles HTTP/1.1 and H2 by default, otherwise you can specify protocols via the
alpn_protocolargument) which run the user's request handler
The client value can be made by Http_mirage_client.Make.connect to be able to launch HTTP requests to Let's encrypt.
Every 80 days, the fiber re-askes a new certificate from let's encrypt and re-update the ALPN server with this new certificate. The HTTP/1.1 server does the redirection to the hostname defined into the given cfg.
NOTE: For the alpn_protocols argument, only "h2", "http/1.1" and "http/1.0" are handled. Any others protocols will be ignored! The order of protocols matters. If "h2" is the first one and the client handles the "h2" protocol, server and client agree to use this protocol (even if both handle "http/1.1").
The default value of alpn_protocols prioritises "http/1.1" as the protocol which should be picked by the client.