0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-23 22:27:38 -05:00
caddy/caddytls
Matthew Holt e3f2d96a5e
httpserver: Flags to customize HTTP and HTTPS ports (incl. for ACME)
This commit removes _almost_ all instances of hard-coded ports 80 and
443 strings, and now allows the user to define what the HTTP and HTTPS
ports are by the -http-port and -https-ports flags.

(One instance of "80" is still hard-coded in tls.go because it cannot
import httpserver to get access to the HTTP port variable. I don't
suspect this will be a problem in practice, but one workaround would be
to define an exported variable in the caddytls package and let the
httpserver package set it as well as its own HTTPPort variable.)

The port numbers required by the ACME challenges HTTP-01 and TLS-SNI-01
are hard-coded into the spec as ports 80 and 443 for good reasons,
but the big question is whether they necessarily need to be the HTTP
and HTTPS ports. Although the answer is probably no, they chose those
ports for convenience and widest compatibility/deployability. So this
commit also assumes that the "HTTP port" is necessarily the same port
on which to serve the HTTP-01 challenge, and the "HTTPS port" is
necessarily the same one on which to serve the TLS-SNI-01 challenge. In
other words, changing the HTTP and HTTPS ports also changes the ports
the challenges will be served on.

If you change the HTTP and HTTPS ports, you are responsible for
configuring your system to forward ports 80 and 443 properly.

Closes #918 and closes #1293. Also related: #468.
2017-03-06 18:18:49 -07:00
..
storagetest Refactor and improve TLS storage code (related to locking) 2016-09-19 17:24:34 -06:00
certificates.go tls: Refactor internals related to TLS configurations (#1466) 2017-02-21 09:49:22 -07:00
certificates_test.go fix typo 2016-08-09 14:57:17 +09:00
client.go httpserver: Flags to customize HTTP and HTTPS ports (incl. for ACME) 2017-03-06 18:18:49 -07:00
client_test.go Rewrote Caddy from the ground up; initial commit of 0.9 branch 2016-06-04 17:00:29 -06:00
config.go httpserver: Flags to customize HTTP and HTTPS ports (incl. for ACME) 2017-03-06 18:18:49 -07:00
config_test.go tls: Refactor internals related to TLS configurations (#1466) 2017-02-21 09:49:22 -07:00
crypto.go Set session ticket keys properly (fixed in Go 1.8) 2017-01-15 09:30:02 -07:00
crypto_test.go Remove dead code, do struct alignment, simplify code 2016-10-25 19:19:54 +02:00
filestorage.go Refactor and improve TLS storage code (related to locking) 2016-09-19 17:24:34 -06:00
filestorage_test.go Pluggable TLS Storage (#913) 2016-07-08 07:32:31 -06:00
handshake.go tls: Refactor internals related to TLS configurations (#1466) 2017-02-21 09:49:22 -07:00
handshake_test.go tls: Refactor internals related to TLS configurations (#1466) 2017-02-21 09:49:22 -07:00
httphandler.go Set listenHost to localhost if empty; fixes test on Windows 2016-12-23 10:28:00 -07:00
httphandler_test.go ACME challenge proxy now accounts for ListenHost (bind); fixes #1296 2016-12-23 09:40:03 -07:00
maintain.go tls: Refactor internals related to TLS configurations (#1466) 2017-02-21 09:49:22 -07:00
setup.go tls: Refactor internals related to TLS configurations (#1466) 2017-02-21 09:49:22 -07:00
setup_test.go tls: Refactor internals related to TLS configurations (#1466) 2017-02-21 09:49:22 -07:00
storage.go Refactor and improve TLS storage code (related to locking) 2016-09-19 17:24:34 -06:00
tls.go Refactor and improve TLS storage code (related to locking) 2016-09-19 17:24:34 -06:00
tls_test.go Refactor and improve TLS storage code (related to locking) 2016-09-19 17:24:34 -06:00
user.go Fix small misspellings 2017-01-10 13:09:24 -08:00
user_test.go tls: Improve flaky test depending on CPU scheduling (I think) 2016-11-28 23:37:22 -07:00