@marcel91200 / caddy Mirror · read-only / commits / d949caf4
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 12, 20:45 UTC

test: acmeserver: add smoke test for the ACME server directory (#5914)

Mohammed Al Sahaf committed Oct 24, 2023 at 20:59 UTC d949caf459c3e046e6f4020dbb685c07812d5b80
1 file changed +33
caddytest/integration/acmeserver_test.go new
+33
@@ -0,0 +1,33 @@
1 +package integration
2 +
3 +import (
4 + "testing"
5 +
6 + "github.com/caddyserver/caddy/v2/caddytest"
7 +)
8 +
9 +func TestACMEServerDirectory(t *testing.T) {
10 + tester := caddytest.NewTester(t)
11 + tester.InitServer(`
12 + {
13 + skip_install_trust
14 + local_certs
15 + admin localhost:2999
16 + http_port 9080
17 + https_port 9443
18 + pki {
19 + ca local {
20 + name "Caddy Local Authority"
21 + }
22 + }
23 + }
24 + acme.localhost:9443 {
25 + acme_server
26 + }
27 + `, "caddyfile")
28 + tester.AssertGetResponse(
29 + "https://acme.localhost:9443/acme/local/directory",
30 + 200,
31 + `{"newNonce":"https://acme.localhost:9443/acme/local/new-nonce","newAccount":"https://acme.localhost:9443/acme/local/new-account","newOrder":"https://acme.localhost:9443/acme/local/new-order","revokeCert":"https://acme.localhost:9443/acme/local/revoke-cert","keyChange":"https://acme.localhost:9443/acme/local/key-change"}
32 +`)
33 +}