sasa1977 / site_encrypt

Integrated certification via Let's encrypt for Elixir-powered sites
MIT License
462 stars 33 forks source link

Error while ordering a new certificate #37

Closed jung-hunsoo closed 2 years ago

jung-hunsoo commented 2 years ago

I'm trying this onto one of my project today. After some configuration, it seems that the cert files are created properly. But, it didn't work as expected with match error produced. Is there any clue?

Following is a bit of log;

Jul 20 13:16:28 * systemd[1]: Started API Backend server for *.
Jul 20 13:16:42 *: 13:16:42.560 [info] Generating a temporary self-signed certificate. This certificate will be used until a proper certificate is issued by the CA server.
Jul 20 13:16:42 *: 13:16:42.681 [info] Running *ApiWeb.Endpoint with cowboy 2.8.0 at 0.0.0.0:80 (http)
Jul 20 13:16:42 *: 13:16:42.736 [info] Running *ApiWeb.Endpoint with cowboy 2.8.0 at 0.0.0.0:4001 (https)
Jul 20 13:16:42 *: 13:16:42.738 [info] Access *ApiWeb.Endpoint at https://my-url.com:4001
Jul 20 13:16:42 *: 13:16:42.744 [info] Creating new account (CA acme-v02.api.letsencrypt.org)
Jul 20 13:16:45 *: 13:16:45.774 [info] Ordering a new certificate for domain * (CA acme-v02.api.letsencrypt.org)
Jul 20 13:20:43 *: 13:20:43.366 [error] Task #PID<0.4605.0> started from #PID<0.4383.0> terminating
Jul 20 13:20:43 *: ** (MatchError) no match of right hand side value: {:error, #SiteEncrypt.Acme.Client.API.Session<https://acme-v02.api.letsencrypt.org/directory>}
Jul 20 13:20:43 *:     (site_encrypt 0.4.2) lib/site_encrypt/acme/client.ex:74: SiteEncrypt.Acme.Client.process_new_order/3
Jul 20 13:20:43 *:     (site_encrypt 0.4.2) lib/site_encrypt/acme/client.ex:45: SiteEncrypt.Acme.Client.create_certificate/2
Jul 20 13:20:43 *:     (site_encrypt 0.4.2) lib/site_encrypt/certification/native.ex:52: SiteEncrypt.Certification.Native.create_certificate/2
Jul 20 13:20:43 *:     (site_encrypt 0.4.2) lib/site_encrypt/certification/job.ex:15: SiteEncrypt.Certification.Job.certify/1
Jul 20 13:20:43 *:     (site_encrypt 0.4.2) lib/site_encrypt/certification/job.ex:26: SiteEncrypt.Certification.Job.certify_and_apply/1
Jul 20 13:20:43 *:     (elixir 1.11.2) lib/task/supervised.ex:90: Task.Supervised.invoke_mfa/2
Jul 20 13:20:43 *:     (stdlib 3.13.1) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
Jul 20 13:20:43 *: Function: #Function<0.98732140/0 in SiteEncrypt.Certification.Job.child_spec/1>
Jul 20 13:20:43 *:     Args: []
jung-hunsoo commented 2 years ago

Connecting to staging server also produces same error on lib/site_encrypt/acme/client.ex:74 line.

jung-hunsoo commented 2 years ago

Also tried ':certbot', but no luck.

Jul 23 00:23:07 *: 00:23:07.285 [error] usage:
Jul 23 00:23:07 *:   certbot [SUBCOMMAND] [options] [-d DOMAIN] [-d DOMAIN] ...
Jul 23 00:23:07 *: Certbot can obtain and install HTTPS/TLS/SSL certificates.  By default,
Jul 23 00:23:07 *: it will attempt to use a webserver both for obtaining and installing the
Jul 23 00:23:07 *: certificate.
Jul 23 00:23:07 *: certbot: error: unrecognized arguments: my@email.com
Jul 23 00:23:07 *: 00:23:07.285 [error] Error obtaining certificate for my-url.com
Jul 23 00:52:09 *: 00:52:09.772 request_id=FpRFRWcfO [info] GET /
Jul 23 00:52:09 *: 00:52:09.774 request_id=FpRFRWcfO [info] Sent 404 in 1ms
jung-hunsoo commented 2 years ago

Ended up using official certbot instead.