Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/claviering/https-nodeJS
create https server using nodeJS
https://github.com/claviering/https-nodeJS
express https nodejs tls
Last synced: 20 days ago
JSON representation
create https server using nodeJS
- Host: GitHub
- URL: https://github.com/claviering/https-nodeJS
- Owner: claviering
- Created: 2018-11-18T14:38:43.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-09T11:06:16.000Z (almost 2 years ago)
- Last Synced: 2024-07-30T20:54:35.654Z (4 months ago)
- Topics: express, https, nodejs, tls
- Language: JavaScript
- Size: 479 KB
- Stars: 0
- Watchers: 0
- Forks: 1
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nodeJS 搭建 https 服务
openssl 1.1.1 版本
node v10
## pm2 监控程序
```
npm i -D pm2
npm i -g pm2
pm2 start npm -- run dev
pm2 list
pm2 show id
pm2 monit
pm2 logs
pm2 reload all
pm2 stop
pm2 restart
pm2 delete
```## 脚本创建证书
开发环境
./app/env/dev/gencert.sh
需要配置 `rootCA.conf` 和 `server.conf` 生产根证书, 前面证书
## 创建根证书
```
openssl version -a
openssl genrsa -des3 -out rootCA.key 2048
openssl req -x509 -new -config rootCA.conf -key rootCA.key -sha256 -days 3650 -out rootCA.pem```
## chrome 浏览器添加根证书Settings -> Advanced -> Manage certificates
选择 System
选择 Certificates
选择证书文件, 查看 detail -> Trust -> When using this certificate -> Always Trust
## 创建证书签名申请
certificate signing request
```
openssl genrsa -out server.key 2048
openssl req -new -config server.conf -out server.csr
```
## 签发证书
创建一个v3.ext文件,以创建一个X509 v3证书。注意我们指定了subjectAltName选项
```
openssl x509 -req -in server.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out server.crt -days 3650 -sha256 -extfile v3.ext
```