Skip to content

Commit 5ddb90a

Browse files
committed
openssl for windows
1 parent 229e609 commit 5ddb90a

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
},
4040
"scripts": {
4141
"lint": "eslint . && node ./scripts/lint-readme.js",
42-
"test": "test/support/gencert.sh && mocha --require test/support/env --check-leaks --bail --no-exit --reporter spec test/",
42+
"test": "bash -c '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",
4545
"version": "node scripts/version-history.js && git add HISTORY.md"

Diff for: test/support/gencert.sh

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
#! /bin/sh
2-
set -ex
2+
set -e
3+
4+
# Detect OS
5+
OS="$(uname -s)"
6+
7+
# Define file paths
8+
KEY_PATH="./test/fixtures/server.key"
9+
CERT_PATH="./test/fixtures/server.crt"
10+
SUBJ="/C=US/ST=Illinois/L=Chicago/O=node-express-session/CN=express-session.local"
11+
12+
if [[ "$OS" == MINGW* || "$OS" == MSYS* ]]; then
13+
SUBJ=/"/C=US/ST=Illinois/L=Chicago/O=node-express-session/CN=express-session.local"
14+
fi
315

416
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"
17+
-subj "$SUBJ"

0 commit comments

Comments
 (0)