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

Add ability to specify certificate #47

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

bdukes
Copy link

@bdukes bdukes commented Nov 9, 2022

Our standard dev setup includes using local domains with generated certificates (e.g. https://client.local), so being able to pass a trusted certificate through to elm-watch improves our experience quite a bit. Let me know if there are any changes you'd like to my approach here. Thanks!

@lydell
Copy link
Owner

lydell commented Nov 9, 2022

Hi! We were talking about being able to specify a certificate there: #46 (comment)

I was thinking the config would point to two files instead of having to paste the certificates in the config itself. What do you say?

@bdukes
Copy link
Author

bdukes commented Nov 9, 2022

We can do that also. I was trying to get the input as close to the Node.js options as I could to avoid extra processing, but storing them as files is definitely easier for the most common scenarios. I'll try to find some time tomorrow to adjust the implementation. Thanks!

@bdukes
Copy link
Author

bdukes commented Nov 10, 2022

@lydell I've pushed a change for the configuration to point to a file instead of containing the certificate contents. Let me know if there's anything else you need. Thanks!

@lydell
Copy link
Owner

lydell commented Nov 14, 2022

Thanks! I’ll look into this soon. I’m going to update the docs, write tests (this repo has 100 % coverage), review error messages etc.

@lydell
Copy link
Owner

lydell commented Dec 1, 2022

Here are some rough notes I made for myself (just to show you what the status is):

  • better error messages when decoding
    • I think it makes sense to do it inside the decoders
    • another way of doing it is reading the files when doing https.createServer()
      • since that can fail anyway (see below). Not sure if easier.
  • mix up key and cert -> “unexpected error” and exit. https.createServer() throws? or error event?
  • simplify CertificateChoice away? Does not seem to need to be able to tell them apart
  • switch to read the built in cert from files too?
  • make sure that when reading, it’s relative to elm-watch.json, not cwd
  • update docs mentioning “let me know if you need this”
  • maybe easier to start from scratch in my own branch and use his as inspiration
  • write tests

I want to do that soon, but now it’s December and other things usually get in the way.

@lydell
Copy link
Owner

lydell commented Nov 15, 2023

I’m sorry I never got around to finishing this. I’m finally starting to get more time for open source again. The current plan for this is here: #74

If you’re still interested in this, it would be very helpful if you could comment on #74 if that approach would work for you!

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

Successfully merging this pull request may close these issues.

2 participants