Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/remi/plug_letsencrypt

PlugLetsEncrypt responds to Let’s Encrypt domain verification requests.
https://github.com/remi/plug_letsencrypt

elixir http letsencrypt plug

Last synced: 27 days ago
JSON representation

PlugLetsEncrypt responds to Let’s Encrypt domain verification requests.

Awesome Lists containing this project

README

        

PlugLetsEncrypt
=================

[![Travis](https://img.shields.io/travis/remiprev/plug_letsencrypt.svg?style=flat-square)](https://travis-ci.org/remiprev/plug_letsencrypt)
[![Hex.pm](https://img.shields.io/hexpm/v/plug_letsencrypt.svg?style=flat-square)](https://hex.pm/packages/plug_letsencrypt)

`PlugLetsEncrypt` responds to Let’s Encrypt domain verification requests.

Installation
------------

Add `plug_letsencrypt` to the `deps` function in your project's `mix.exs` file:

```elixir
defp deps do
[
…,
{:plug_letsencrypt, "~> 0.2"}
]
end
```

Then run `mix do deps.get, deps.compile` inside your project's directory.

Usage
-----

`PlugLetsEncrypt` can be used just as any other plugs. Add `PlugLetsEncrypt`
with your other plugs and provide a response to serve.

```elixir
defmodule Endpoint do
plug PlugLetsEncrypt, response: System.get_env("LETSENCRYPT_RESPONSE")
end
```

The `LETSENCRYPT_RESPONSE` is the response Let’s Encrypt will be looking for,
something like:

```bash
LETSENCRYPT_RESPONSE=esLXAidxzFUn2kkakqeqwe4Z6VqtechtQtF0.yJLghAfMirn4ejUskeB-GrqSb411923hjX-OWUvDtgc
```

The result:

```bash
$ curl -XGET "http://localhost:4000/.well-known/acme-challenge/esLXAidxzFUn2kkakqeqwe4Z6VqtechtQtF0"
esLXAidxzFUn2kkakqeqwe4Z6VqtechtQtF0.yJLghAfMirn4ejUskeB-GrqSb411923hjX-OWUvDtgc

$ curl -XGET "http://localhost:4000/.well-known/acme-challenge/anything"
```

License
-------

`PlugLetsEncrypt` is © 2017 [Rémi Prévost](http://exomel.com) and may be
freely distributed under the [MIT license](https://github.com/remiprev/plug_letsencrypt/blob/master/LICENSE.md). See the
`LICENSE.md` file for more information.