I’m trying to get Caddy working on a different https port, but even tough, based on my understanding of the documentation and the different answers I’ve found around the web, defining no http listener and a DNS plugin should make the auto-ssl part not bind to 80.
Yet with the following config caddy still tries to bind to 80:
Breaking any of these conditions will disable Automatic HTTPS (except the last one, that will just have Caddy exit out). Basically, good options are to provide your own keys (or use self-signed, although those self-signed certs are short-lived and not renewed, so this isn’t good long term) or turn TLS off.
-http-port will not break your DNS challenges. It just moves the redirect listener to a different port, essentially (as a side-effect of changing the default HTTP port for all sites).
Er, that is true I suppose, as not exiting is itself a prerequisite to enabling automatic HTTPS. I see what you mean about why this is confusing.
Caddy 1 also enables HTTP->HTTPS redirects, using the -http-port flag to know what the HTTP port is supposed to be. Because web browsers still default to HTTP, Caddy 1 doesn’t allow these automatic redirects to be disabled. (But Caddy 2 does, FWIW.)