Curl fails:
curl -v https://service1.lc
VERBOSE: GET with 0-byte payload
curl : The underlying connection was closed: An unexpected error occurred on a send.
At line:1 char:1
+ curl -v https://service1.lc
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
Ping succeds:
ping service1.lc
Pinging service1.lc [127.0.0.1] with 32 bytes of data:
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Ping statistics for 127.0.0.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
It seems that the request does not reach Caddy:
PS C:\src\XYZ\CaddyProxy> caddy run
2023/06/05 11:49:42.775 INFO using adjacent Caddyfile
2023/06/05 11:49:42.782 INFO admin admin endpoint started {"address": "localhost:2019", "enforce_origin": false, "origins": ["//localhost:2019", "//[::1]:2019", "//127.0.0.1:2019"]}
2023/06/05 11:49:42.783 INFO tls.cache.maintenance started background certificate maintenance {"cache": "0xc0004808c0"}
2023/06/05 11:49:42.784 INFO http server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS {"server_name": "srv0", "https_port": 443}
2023/06/05 11:49:42.784 INFO http enabling automatic HTTP->HTTPS redirects {"server_name": "srv0"}
2023/06/05 11:49:42.810 INFO pki.ca.local root certificate is already trusted by system {"path": "storage:pki/authorities/local/root.crt"}
2023/06/05 11:49:42.810 INFO tls cleaning storage unit {"description": "FileStorage:C:\\Users\\MyUser\\AppData\\Roaming\\Caddy"}
2023/06/05 11:49:42.811 INFO http enabling HTTP/3 listener {"addr": ":443"}
2023/06/05 11:49:42.811 DEBUG http starting server loop {"address": "[::]:443", "tls": true, "http3": true}
2023/06/05 11:49:42.811 INFO http.log server running {"name": "srv0", "protocols": ["h1", "h2", "h3"]}
2023/06/05 11:49:42.812 DEBUG http starting server loop {"address": "[::]:80", "tls": false, "http3": false}
2023/06/05 11:49:42.812 INFO http.log server running {"name": "remaining_auto_https_redirects", "protocols": ["h1", "h2", "h3"]}
2023/06/05 11:49:42.812 INFO http enabling automatic TLS certificate management {"domains": ["s1.localhost", "service1.lc", "service1.lh", "service1.localhost", "service1.local"]}
2023/06/05 11:49:42.813 WARN tls stapling OCSP {"error": "no OCSP stapling for [s1.localhost]: no OCSP server specified in certificate", "identifiers": ["s1.localhost"]}
2023/06/05 11:49:42.813 DEBUG tls.cache added certificate to cache {"subjects": ["s1.localhost"], "expiration": "2023/06/05 17:20:05.000", "managed": true, "issuer_key": "local", "hash": "a6018d4cc7084ada2826e978fc8d25e9582b4bb4f4562a562a5eecc4d1379167", "cache_size": 1, "cache_capacity": 10000}
2023/06/05 11:49:42.813 DEBUG events event {"name": "cached_managed_cert", "id": "7a03d25c-1ee0-4156-b81d-79bef4309960", "origin": "tls", "data": {"sans":["s1.localhost"]}}
2023/06/05 11:49:42.814 WARN tls stapling OCSP {"error": "no OCSP stapling for [service1.lc]: no OCSP server specified in certificate", "identifiers": ["service1.lc"]}
2023/06/05 11:49:42.814 DEBUG tls.cache added certificate to cache {"subjects": ["service1.lc"], "expiration": "2023/06/05 23:23:26.000", "managed": true, "issuer_key": "local", "hash": "b6e5ce04214e3dc75133c658ad9edabe8e73a445b893abaf26b617ff531890e1", "cache_size": 2, "cache_capacity": 10000}
2023/06/05 11:49:42.814 DEBUG events event {"name": "cached_managed_cert", "id": "4869ca58-33f1-4bfc-b038-c0c0bba7b4f0", "origin": "tls", "data": {"sans":["service1.lc"]}}
2023/06/05 11:49:42.815 WARN tls stapling OCSP {"error": "no OCSP stapling for [service1.lh]: no OCSP server specified in certificate", "identifiers": ["service1.lh"]}
2023/06/05 11:49:42.815 DEBUG tls.cache added certificate to cache {"subjects": ["service1.lh"], "expiration": "2023/06/05 23:23:26.000", "managed": true, "issuer_key": "local", "hash": "b77b1e7a639a4410ec3f3262881fe4ca09db7e638399e83e56999f87ba95833c", "cache_size": 3, "cache_capacity": 10000}
2023/06/05 11:49:42.815 DEBUG events event {"name": "cached_managed_cert", "id": "85442d8d-c75f-4ce2-b146-3d55f3ea6616", "origin": "tls", "data": {"sans":["service1.lh"]}}
2023/06/05 11:49:42.815 WARN tls stapling OCSP {"error": "no OCSP stapling for [service1.localhost]: no OCSP server specified in certificate", "identifiers": ["service1.localhost"]}
2023/06/05 11:49:42.816 DEBUG tls.cache added certificate to cache {"subjects": ["service1.localhost"], "expiration": "2023/06/05 23:32:46.000", "managed": true, "issuer_key": "local", "hash": "393621722ddceec3b6e0b71709a6be904570a2abb234a2191412d45f04b962b2", "cache_size": 4, "cache_capacity": 10000}
2023/06/05 11:49:42.816 DEBUG events event {"name": "cached_managed_cert", "id": "cc67ff73-535d-4697-bef9-b763af5ddb55", "origin": "tls", "data": {"sans":["service1.localhost"]}}
2023/06/05 11:49:42.816 WARN tls stapling OCSP {"error": "no OCSP stapling for [service1.local]: no OCSP server specified in certificate", "identifiers": ["service1.local"]}
2023/06/05 11:49:42.816 DEBUG tls.cache added certificate to cache {"subjects": ["service1.local"], "expiration": "2023/06/05 23:23:26.000", "managed": true, "issuer_key": "local", "hash": "b5d37b9fb6ee688aa5065c157a869fc0468849b8e73add58aee0e1b4575718d8", "cache_size": 5, "cache_capacity": 10000}
2023/06/05 11:49:42.816 DEBUG events event {"name": "cached_managed_cert", "id": "823e5820-93e0-4c3f-9554-ad918adce9f7", "origin": "tls", "data": {"sans":["service1.local"]}}
2023/06/05 11:49:42.817 INFO autosaved config (load with --resume flag) {"file": "C:\\Users\\MyUser\\AppData\\Roaming\\Caddy\\autosave.json"}
2023/06/05 11:49:42.817 INFO serving initial configuration
2023/06/05 11:49:42.820 INFO tls finished cleaning storage units