@jsenv/https-local 3.1.1 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/https_local_cli.mjs +15 -0
package/package.json
CHANGED
package/src/https_local_cli.mjs
CHANGED
|
@@ -25,6 +25,9 @@ if (values.help || positionals.length === 0) {
|
|
|
25
25
|
|
|
26
26
|
Usage:
|
|
27
27
|
|
|
28
|
+
npx @jsenv/https-local setup
|
|
29
|
+
Install root certificate, try to trust it and ensure localhost is mapped to 127.0.0.1
|
|
30
|
+
|
|
28
31
|
npx @jsenv/https-local install --trust
|
|
29
32
|
Install root certificate on the filesystem
|
|
30
33
|
- trust: Try to add root certificate to os and browser trusted stores.
|
|
@@ -43,6 +46,18 @@ https://github.com/jsenv/core/tree/main/packages/independent/https-local
|
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
const commandHandlers = {
|
|
49
|
+
setup: async () => {
|
|
50
|
+
await installCertificateAuthority({
|
|
51
|
+
tryToTrust: true,
|
|
52
|
+
NSSDynamicInstall: true,
|
|
53
|
+
});
|
|
54
|
+
await verifyHostsFile({
|
|
55
|
+
ipMappings: {
|
|
56
|
+
"127.0.0.1": ["localhost"],
|
|
57
|
+
},
|
|
58
|
+
tryToUpdatesHostsFile: true,
|
|
59
|
+
});
|
|
60
|
+
},
|
|
46
61
|
install: async ({ tryToTrust }) => {
|
|
47
62
|
await installCertificateAuthority({
|
|
48
63
|
tryToTrust,
|