-
Notifications
You must be signed in to change notification settings - Fork 40
chore NET-1404: remove deprecated package request
from autocert-*
#2996
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
Conversation
request
from autocert-*
packages/autocertifier-server/test/integration/RestServer-real-http-client.test.ts
Outdated
Show resolved
Hide resolved
There is a test in the autocertifier-server that tests that the integration between the client and server works. It should check that the basic functionality is okay.
This is something that should be checked by running the client against the production server. I do believe there is a proper TLS certificate there so this should not be required. |
f67c6f2
to
2ce4156
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good simplification indeed, many lines of code less. However, one thing to discuss is whether we should move to using fetch already. Fetch will be available in the global object the same way as in browsers starting from NodeJS 21, and we could fall back to node-fetch package on older NodeJS versions. You can see see this post about fetch in node: https://blog.logrocket.com/fetch-api-node-js/
I had a go at using built-in node.js fetch to accomplish this first, however there seems to be no way of passing a option to allow for self-signed certificates or to disable certificate validation. Apparently to achieve this you need to install a package |
Summary
Package
request
has been deprecated since 2020. Removed its usage from sub-packagesautocertifier-server
andautocertifier-client
and replaced with with nativehttps
module's request functionality.Also made test packages/autocertifier-server/test/integration/RestServer-real-http-client.test.ts exercise the new HTTP requesting utility in
autocertifier-client
to gain more test coverage confidence.I tested the certificate fetching process by hand by creating a new cloud instance and installing this branch there. My node was successfully able to get a subdomain and cert assigned to itself by the production autocertifier-server.
Future improvements
Use built-in node.js
fetch
instead ofhttps
. However, see the discussion of this PR as to how this needs to be approached.Checklist before requesting a review
TODO
comments left behind are meant to be left in.