New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caddy startup output is incorrect when hosting HTTP on port 443 #2461

Open
whitestrake opened this Issue Feb 9, 2019 · 4 comments

Comments

Projects
None yet
4 participants
@whitestrake
Copy link
Collaborator

whitestrake commented Feb 9, 2019

1. What version of Caddy are you using (caddy -version)?

Caddy 0.11.3 (non-commercial use only)

2. What are you trying to do?

Host a website on port 443.

3. What is your entire Caddyfile?

N/A - easily reproducible without a Caddyfile

4. How did you run Caddy (give the full command and describe the execution environment)?

caddy -port 443

5. Please paste any relevant HTTP request(s) here.

curl https://localhost - fails, naturally, because we haven't enabled TLS

curl http://localhost:443 - succeeds as expected

6. What did you expect to see?

Activating privacy features... done.
http://:443

7. What did you see instead (give full error messages and/or log)?

Activating privacy features... done.
https://

8. How can someone who is starting from scratch reproduce the bug as minimally as possible?

See point 4.


Pretty simple issue. Startup output says https:// if you're hosting a site on port 443, regardless of whether it's actually HTTPS or not...

@tobya

This comment has been minimized.

Copy link
Collaborator

tobya commented Feb 17, 2019

Is a solution to this simply to disallow hosting a http site on port 443?

It seems to me that anyone wishing to do this is just trying to cause themselves trouble?

Would simply raising an error and exiting be a valid fix?

@mholt

This comment has been minimized.

Copy link
Owner

mholt commented Feb 17, 2019

These are good questions... I kind of designed Caddy to fight against unconventional choices which are "only confusing or problematic" but I can't foresee all valid uses either.

Are there good reasons to serve HTTP on port 443? Or HTTPS on port 80? I feel like that defies the port's IANA reservations.

@mholt

This comment has been minimized.

Copy link
Owner

mholt commented Feb 17, 2019

@whitestrake What is your use case? Why do you need HTTP on port 443?

@magikstm

This comment has been minimized.

Copy link
Collaborator

magikstm commented Feb 17, 2019

Is a solution to this simply to disallow hosting a http site on port 443?

It seems to me that anyone wishing to do this is just trying to cause themselves trouble?

Would simply raising an error and exiting be a valid fix?

I think it would be a good fix. As @mholt noted, it defies the IANA reservations.

Ref: https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=443

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment