Skip to content
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

Tls self_signed - Not working correctly since a few versions #2502

Closed
magikstm opened this issue Mar 5, 2019 · 14 comments
Closed

Tls self_signed - Not working correctly since a few versions #2502

magikstm opened this issue Mar 5, 2019 · 14 comments
Assignees
Labels
bug 🐞 Something isn't working
Milestone

Comments

@magikstm
Copy link

magikstm commented Mar 5, 2019

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

Caddy 0.11.5 (non-commercial use only)

2. What are you trying to do?

Use tls self_signed for a local development Caddy server.

3. What is your Caddyfile?

:2021 {
root C:\sites\1
log “” access2019.log “{remote} | {>User-Agent} | {user} | {when} | {method} | {uri} | {proto} | {status} | {size} | {latency_ms}”

gzip
on startup php_cgi2.bat &
fastcgi / 127.0.0.1:6545 php
tls self_signed
}

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

I'm using Windows 7 x64.

I typed "caddy" in cmd in the folder containing caddy.exe.

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

N/A

6. What did you expect to see?

Server starting and running normally.

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

2019/03/04 19:39:27 self-signed: certificate has no names

8. Why is this a bug, and how do you think this should be fixed?

It doesn't respect docs here:
https://caddyserver.com/docs/tls

It worked correctly with Caddy 0.11.1.

9. What are you doing to work around the problem in the meantime?

I commented this line:

tls self_signed

10. Please link to any related issues, pull requests, and/or discussion.

https://caddy.community/t/tls-self-signed-windows-7-x64-caddy-0-11-5/5299

Bonus: What do you use Caddy for? Why did you choose Caddy?

@mholt mholt added the bug 🐞 Something isn't working label Mar 5, 2019
@abiosoft abiosoft self-assigned this Mar 8, 2019
@mholt
Copy link
Member

mholt commented Mar 9, 2019

Thanks for the report. I could reproduce it. This one might require a change in CertMagic to fix fully.

@francislavoie
Copy link
Member

@STaRDoGG see PR #2531, it's a work in progress.

@linquize
Copy link
Contributor

Should this issue be fixed in 1.0.0? Many users use self sign cert for development purpose

@mholt
Copy link
Member

mholt commented Apr 20, 2019

I'll get around to it soon. It's not a blocker for 1.0, and I'm currently redesigning how self-signed certs are managed.

@magikstm
Copy link
Author

Is this issue still considered for Caddy 1.x?

I tested with Caddy 1.0.3 and I still have the issue.

@mholt
Copy link
Member

mholt commented Nov 11, 2019

It will probably be worked on more for Caddy 2, tbh. Caddy 2 is really close to being "done" (for an initial stable release).

@sergeevabc
Copy link

Agggrrrhh. What’s the proper way to get HTTPS working on localhost with Caddy2?

localhost, localhost:80, localhost:443
tls self_signed
file_server browse
encode zstd gzip

outputs

run: adapting config using caddyfile: parsing caddyfile tokens for 'tls':
Caddyfile:2 - Error during parsing: single argument must be an email address

@mholt
Copy link
Member

mholt commented Feb 3, 2020

There is no self_signed in Caddy 2. The v1 implementation was bad. I have a call today with a company to discuss implementing something better than it over the next few months, so just hang tight.

@mholt
Copy link
Member

mholt commented Mar 7, 2020

Anyone interested in this please follow #3125 and try it out ASAP, it will be the successor to the v1 self_signed feature. Thanks!

@mholt mholt closed this as completed Mar 7, 2020
@sergeevabc
Copy link

@mholt, how is one supposed to try it if there is no binary attached?

@mholt
Copy link
Member

mholt commented Mar 7, 2020

For now, just clone the branch and run go build from the cmd/caddy folder.

@francislavoie
Copy link
Member

@sergeevabc you should also be able to try it with one of the CI build artifacts: https://dev.azure.com/mholt-dev/Caddy/_build/results?buildId=927&view=artifacts&type=publishedArtifacts

@sergeevabc
Copy link

I managed to download Caddy2’s binary thanks to @francislavoie, but not sure how to proceed with configuration, because I do not and never will use JSON for configuration. Caddyfile looks as follows

localhost:80
file_server browse
encode zstd gzip

I tried adding issuer internal, but with no success. What should I add there?

@francislavoie
Copy link
Member

If you read the PR, you'll see that Caddyfile support isn't ready yet for this feature. In the meantime, you can easily convert your Caddyfile config to JSON with the caddy adapt command and go from there.

mholt added a commit that referenced this issue Mar 13, 2020
…es (#3125)

* pki: Initial commit of PKI app (WIP) (see #2502 and #3021)

* pki: Ability to use root/intermediates, and sign with root

* pki: Fix benign misnamings left over from copy+paste

* pki: Only install root if not already trusted

* Make HTTPS port the default; all names use auto-HTTPS; bug fixes

* Fix build - what happened to our CI tests??

* Fix go.mod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants