site_encrypt v0.1.0 SiteEncrypt.Phoenix.Test View Source

Helper for testing the certification.

Usage

defmodule MyEndpoint.CertificationTest do
  use SiteEncrypt.Phoenix.Test, endpoint: MyEndpoint
end

This will generate a single test which does the following:

  1. Stops the endpoint, and removes the db_folder and the backup.
  2. Restarts the endpoint, temporarily setting server: true.
  3. Waits for the certification to finish.
  4. Verifies that the site is serving the traffic using the new certificate.

For this to work, you need to use the internal ACME server during tests. Refer to SiteEncrypt.configure/1 for details.