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

run daemon in https and automatic https #24

Open
dfang opened this issue Jul 21, 2020 · 3 comments
Open

run daemon in https and automatic https #24

dfang opened this issue Jul 21, 2020 · 3 comments

Comments

@dfang
Copy link

dfang commented Jul 21, 2020

insecure receiver listens on http port, the url will be like http://IP:PORT, you can't send ajax requests on a https page.

automatic https support like caddy, and with auth token in header would be better .....

no need to remove insecure receiver, it's best for testing

@dfang dfang changed the title add a secure receiver run daemon in https and automatic https Jul 21, 2020
@thisisaaronland
Copy link
Member

thisisaaronland commented Jul 21, 2020

This is possible but it is poorly documented (so I will leave this issue open until it is).

The Daemon property of the webhookd config is any valid URI string that can be parsed by the aaronland/go-http-server package:

The go-http-server package does not support automatic certificates (using Let's Encrypt, etc.) yet but if you have a key and certificate pair already you can define the Daemon property to be something like:

https://{HOST}?cert={TLS_CERTIFICATE}&key={TLS_KEY}

@dfang
Copy link
Author

dfang commented Jul 22, 2020

I didn't notice that since my code is still tag v0.13, need to update it to the latest v3.0.1.

adding automatic support is pretty easy, see golang.org/x/crypto/acme/autocert.

if you like, i can send a pull request in that repo.

@thisisaaronland
Copy link
Member

Sure, a PR would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants