Skip to content

Commit 67d61ee

Browse files
committed
✅ always generate fresh cert
1 parent d5baeec commit 67d61ee

File tree

6 files changed

+6
-61
lines changed

6 files changed

+6
-61
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ coverage
33
node_modules
44
npm-debug.log
55
package-lock.json
6+
/test/fixtures/server.crt
7+
/test/fixtures/server.key

package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,9 @@
3939
},
4040
"scripts": {
4141
"lint": "eslint . && node ./scripts/lint-readme.js",
42-
"test": "mocha --require test/support/env --check-leaks --bail --no-exit --reporter spec test/",
42+
"test": "./test/support/gencert.sh && mocha --require test/support/env --check-leaks --bail --no-exit --reporter spec test/",
4343
"test-ci": "nyc --reporter=lcov --reporter=text npm test",
4444
"test-cov": "nyc npm test",
45-
"version": "node scripts/version-history.js && git add HISTORY.md",
46-
"gencert": "./test/support/gencert.sh"
45+
"version": "node scripts/version-history.js && git add HISTORY.md"
4746
}
4847
}

test/fixtures/.gitkeep

Whitespace-only changes.

test/fixtures/server.crt

-21
This file was deleted.

test/fixtures/server.key

-28
This file was deleted.

test/support/gencert.sh

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
#! /bin/sh
22
set -ex
33

4-
openssl genpkey -algorithm RSA -out new_server.key -pkeyopt rsa_keygen_bits:2048
5-
6-
openssl x509 -in ./test/fixtures/server.crt -signkey new_server.key -days 3650 -out new_server.crt
7-
8-
openssl x509 -in new_server.crt -text -noout
9-
10-
mv new_server.crt ./test/fixtures/server.crt
11-
12-
mv new_server.key ./test/fixtures/server.key
4+
openssl req -x509 -nodes -newkey rsa:2048 -keyout ./test/fixtures/server.key -out ./test/fixtures/server.crt -days 3650 \
5+
-subj "/C=US/ST=Illinois/L=Chicago/O=node-express-session/CN=express-session.local"

0 commit comments

Comments
 (0)