{"id":13337952,"url":"https://github.com/claviering/https-nodeJS","last_synced_at":"2025-03-11T08:32:03.884Z","repository":{"id":33486675,"uuid":"158093370","full_name":"claviering/https-nodeJS","owner":"claviering","description":"create https server using nodeJS","archived":false,"fork":false,"pushed_at":"2022-12-09T11:06:16.000Z","size":490,"stargazers_count":0,"open_issues_count":15,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-10-23T20:11:25.445Z","etag":null,"topics":["express","https","nodejs","tls"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/claviering.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-18T14:38:43.000Z","updated_at":"2021-04-18T04:07:09.000Z","dependencies_parsed_at":"2023-01-15T01:07:29.901Z","dependency_job_id":null,"html_url":"https://github.com/claviering/https-nodeJS","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claviering%2Fhttps-nodeJS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claviering%2Fhttps-nodeJS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claviering%2Fhttps-nodeJS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/claviering%2Fhttps-nodeJS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/claviering","download_url":"https://codeload.github.com/claviering/https-nodeJS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243000828,"owners_count":20219750,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["express","https","nodejs","tls"],"created_at":"2024-07-29T19:15:16.420Z","updated_at":"2025-03-11T08:32:03.594Z","avatar_url":"https://github.com/claviering.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nodeJS 搭建 https 服务\n\nopenssl 1.1.1 版本\n\nnode v10\n\n## pm2 监控程序\n\n```\nnpm i -D pm2\nnpm i -g pm2\npm2 start npm -- run dev\npm2 list\npm2 show id\npm2 monit\npm2 logs\npm2 reload all\npm2 stop     \u003capp_name|id|'all'|json_conf\u003e\npm2 restart  \u003capp_name|id|'all'|json_conf\u003e\npm2 delete   \u003capp_name|id|'all'|json_conf\u003e\n```\n\n## 脚本创建证书\n\n开发环境\n\n./app/env/dev/gencert.sh\n\n需要配置 `rootCA.conf` 和 `server.conf` 生产根证书, 前面证书\n\n## 创建根证书\n```\nopenssl version -a\nopenssl genrsa -des3 -out rootCA.key 2048\nopenssl req -x509 -new -config rootCA.conf -key rootCA.key -sha256 -days 3650 -out rootCA.pem\n\n```\n## chrome 浏览器添加根证书\n\nSettings -\u003e Advanced -\u003e Manage certificates\n\n选择 System\n\n选择 Certificates \n\n选择证书文件, 查看 detail -\u003e Trust -\u003e When using this certificate -\u003e Always Trust\n\n## 创建证书签名申请\ncertificate signing request\n```\nopenssl genrsa -out server.key 2048\nopenssl req -new -config server.conf -out server.csr \n```\n## 签发证书\n创建一个v3.ext文件，以创建一个X509 v3证书。注意我们指定了subjectAltName选项\n```\nopenssl x509 -req -in server.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out server.crt -days 3650 -sha256 -extfile v3.ext\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclaviering%2Fhttps-nodeJS","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclaviering%2Fhttps-nodeJS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclaviering%2Fhttps-nodeJS/lists"}