From e5c4caa2be5a3f1985d5e3aab541f3b78a8267c3 Mon Sep 17 00:00:00 2001 From: Akash Kava <39438041+ackava@users.noreply.github.com> Date: Wed, 19 Jun 2024 18:35:46 +0530 Subject: [PATCH] Added ip range --- generated-cert-1 | 1 - index.js | 6 +++--- package.json | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) delete mode 100644 generated-cert-1 diff --git a/generated-cert-1 b/generated-cert-1 deleted file mode 100644 index f381238..0000000 --- a/generated-cert-1 +++ /dev/null @@ -1 +0,0 @@ -{"key":"-----BEGIN RSA PRIVATE KEY-----\r\nMIIEpQIBAAKCAQEA1mEWXIzlZNDIUzh5HGykwFZCndPmiZk7zJa9icdi4JpKdJzD\r\n9FP+NjPdcFpb8FOrf7WU6f0ZcFzenDjdbE69NmESoVmsQBSuMw/sb7RzZlgJ+RDb\r\nJKBkXl7gOL5JyHAFfjABNT5AMzSpPxQwRI6srq42AoFuCtegIFLilfk/T81WJ3D/\r\nN1zjPiZQj7PXQTjjcbWLaxWvUBTewOcsqmGZPjM2h7KCkovb2JKjnRCqV8VyJQj3\r\nHV9pkAfK6ZNWHK3dUpVsC4pi5GTLCnLqXQsN12gR+5AsOqdiAx5eHGE/MgqKwGKB\r\n5Gve+wO6Tb5dN6/sEHQrJJuXosTp09900E7QYQIDAQABAoIBAQCAQQVHyWNTtTSj\r\n1R1fy/+ksfaYxbUejPYhp+0tCIQ3KxdwPHlfKwDjHJRWKzjlxqjLdq7obetSNb1Y\r\naQzPRywb5Gdo8GUE0VqGYfhpu+NuTy1oPJVejDZ/3vL1/6HUsHAY1k9isyNlfxPi\r\nEQnvegwFVWQqi5RyGB5MOEomvz8JVg7lWVpSRGvkQUSnDMZi1JHx6hVRohDyRpJ8\r\nno0XwTsGo4QZNc0rz/3Ng9sL1CC1CSCXEA1/88V+ZhNrnykPhPyOOzwFH6qLr6uM\r\nCNpbccehZmzVP6Zr6ZpcZ5Rzl+uf+wRoGCXTKam9RI1r3S77rBMNb9RTe3T9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o2q2W\r\n8V099yp3yhA8isjIT6HtQXLOYzuWRgNU/8eYRVa5vC4pMoLPF4umSfQO+65MepCU\r\nfLk0DyLQYmB/LGInfEUVOmG3MsHdTZ89cCEJNBT77cY5m0UM6nTJh8H8Ty80fQEc\r\nGl5lVSmu97uIrhw=\r\n-----END CERTIFICATE-----\r\n"} \ No newline at end of file diff --git a/index.js b/index.js index 05901ee..9851fff 100644 --- a/index.js +++ b/index.js @@ -35,7 +35,7 @@ function createCert() { cert.validity.notAfter = new Date(); cert.validity.notAfter.setFullYear(cert.validity.notBefore.getFullYear() + 20); - const altNames = ["127.0.0.1"]; + const altNames = [{ type: 7, ip: "127.0.0.1"}]; for(let i=1;i<255;i++) { altNames.push({ type: 7, ip: `192.168.0.${i}`}); @@ -66,11 +66,11 @@ function createCert() { // here we set subject and issuer as the same one cert.setSubject(attrs); + cert.setIssuer(attrs); cert.setExtensions([{ name: "subjectAltName", altNames - }]) - cert.setIssuer(attrs); + }]); // the actual certificate signing cert.sign(keys.privateKey); diff --git a/package.json b/package.json index da20e95..70e6ee9 100644 --- a/package.json +++ b/package.json @@ -30,8 +30,8 @@ "@web-atoms/pack": "^1.0.69", "colors": "^1.4.0", "express": "^4.17.1", - "http-proxy-middleware": "^2.0.6", - "node-forge": "^0.10.0", + "http-proxy-middleware": "^3.0.0", + "node-forge": "^1.3.1", "open": "^7.2.1", "os": "^0.1.1", "portfinder": "^1.0.28",