1
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-16 21:56:40 -05:00
caddy/modules/caddyhttp
Matt Holt 66863aad3b
caddytls: Add support for ZeroSSL; add Caddyfile support for issuers (#3633)
* caddytls: Add support for ZeroSSL; add Caddyfile support for issuers

Configuring issuers explicitly in a Caddyfile is not easily compatible
with existing ACME-specific parameters such as email or acme_ca which
infer the kind of issuer it creates (this is complicated now because
the ZeroSSL issuer wraps the ACME issuer)... oh well, we can revisit
that later if we need to.

New Caddyfile global option:

    {
        cert_issuer <name> ...
    }

Or, alternatively, as a tls subdirective:

    tls {
        issuer <name> ...
    }

For example, to use ZeroSSL with an API key:

    {
        cert_issuser zerossl API_KEY
    }

For now, that still uses ZeroSSL's ACME endpoint; it fetches EAB
credentials for you. You can also provide the EAB credentials directly
just like any other ACME endpoint:

    {
        cert_issuer acme {
            eab KEY_ID MAC_KEY
        }
    }

All these examples use the new global option (or tls subdirective). You
can still use traditional/existing options with ZeroSSL, since it's
just another ACME endpoint:

    {
        acme_ca  https://acme.zerossl.com/v2/DV90
        acme_eab KEY_ID MAC_KEY
    }

That's all there is to it. You just can't mix-and-match acme_* options
with cert_issuer, because it becomes confusing/ambiguous/complicated to
merge the settings.

* Fix broken test

This test was asserting buggy behavior, oops - glad this branch both
discovers and fixes the bug at the same time!

* Fix broken test (post-merge)

* Update modules/caddytls/acmeissuer.go

Fix godoc comment

Co-authored-by: Francis Lavoie <lavofr@gmail.com>

* Add support for ZeroSSL's EAB-by-email endpoint

Also transform the ACMEIssuer into ZeroSSLIssuer implicitly if set to
the ZeroSSL endpoint without EAB (the ZeroSSLIssuer is needed to
generate EAB if not already provided); this is now possible with either
an API key or an email address.

* go.mod: Use latest certmagic, acmez, and x/net

* Wrap underlying logic rather than repeating it

Oops, duh

* Form-encode email info into request body for EAB endpoint

Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2020-08-11 08:58:06 -06:00
..
caddyauth caddyauth: hash-password: Set bcrypt cost to 14 (#3580) 2020-07-17 12:20:53 -06:00
encode gzip: Use klauspost/gzip, an optimized gzip implementation 2020-04-01 14:09:57 -06:00
fileserver fileserver: Fix newly-introduced failing test on Linux (#3625) 2020-08-01 12:43:30 -06:00
headers push: Implement HTTP/2 server push (#3573) 2020-07-20 12:28:40 -06:00
map caddyhttp: Add 'map' handler (#3199) 2020-06-26 15:12:37 -06:00
push push: Implement HTTP/2 server push (#3573) 2020-07-20 12:28:40 -06:00
requestbody Remove some non-essential plugins from this repo (#2780) 2020-03-24 10:37:47 -06:00
reverseproxy reverseproxy: Minor fixes and cleanup 2020-08-07 18:02:24 -06:00
rewrite httpcaddyfile: New handle_path directive (#3281) 2020-05-26 15:27:51 -06:00
standard push: Implement HTTP/2 server push (#3573) 2020-07-20 12:28:40 -06:00
templates admin,templates,core: Minor enhancements and error handling (#3607) 2020-07-31 16:54:18 -06:00
app.go caddyhttp: Add {http.request.body} placeholder 2020-07-16 19:25:37 -06:00
autohttps.go caddytls: Add support for ZeroSSL; add Caddyfile support for issuers (#3633) 2020-08-11 08:58:06 -06:00
caddyhttp.go reverseproxy: Enable changing only the status code (close #2920) 2020-06-04 12:06:38 -06:00
celmatcher.go caddyhttp: Add support to resolve DN in CEL expression (#3608) 2020-07-31 15:06:30 -06:00
celmatcher_test.go caddyhttp: Add support to resolve DN in CEL expression (#3608) 2020-07-31 15:06:30 -06:00
errors.go http: Change routes to sequential matcher evaluation (#2967) 2020-01-09 10:00:13 -07:00
marshalers.go caddyhttp: Add TLS client cert info to logs (#3640) 2020-08-07 12:12:29 -06:00
matchers.go caddyhttp: Support placeholders in query matcher (#3521) 2020-06-26 15:14:47 -06:00
matchers_test.go caddyhttp: Reorder some access log fields; add host matcher test case 2020-07-07 08:11:35 -06:00
replacer.go caddyhttp: Add {http.request.body} placeholder 2020-07-16 19:25:37 -06:00
replacer_test.go caddyhttp: Corrected host label index check (fix #3502) 2020-06-30 11:43:01 -06:00
responsewriter.go caddyhttp: Fix trailers when recording responses (fixes #3236) 2020-04-22 11:10:13 -06:00
routes.go caddyhttp: Minor refactoring for preparing requests 2020-05-11 12:14:47 -06:00
server.go caddyhttp: Better host matching for logger names (fix #3488) (#3522) 2020-06-26 12:01:50 -06:00
staticerror.go Fix some godocs 2020-04-11 09:01:40 -06:00
staticresp.go caddyhttp: Default to error status if found in context 2020-06-04 10:32:01 -06:00
staticresp_test.go
subroute.go reverseproxy: Enable changing only the status code (close #2920) 2020-06-04 12:06:38 -06:00
vars.go v2: Implement RegExp Vars Matcher (#2997) 2020-02-08 12:26:31 -07:00