sh 用于将工作证书链接到create-react-app的脚本。允许您使用create-react-app和有效的SSL证书。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 用于将工作证书链接到create-react-app的脚本。允许您使用create-react-app和有效的SSL证书。相关的知识,希望对你有一定的参考价值。

#!/bin/bash
# With create-react-app, a self signed (therefore invalid) certificate is generated.
# 1. Create some folder in the root of your project
# 2. Copy your valid development certificate to this folder
# 3. Copy this file to the same folder
# 4. In you package.json, under `scripts`, add `postinstall` script that runs this file.
# Every time a user runs npm install this script will make sure to copy the certificate to the 
# correct location

TARGET_LOCATION="./node_modules/webpack-dev-server/ssl/server.pem"
SOURCE_LOCATION=$(pwd)/$(dirname "./local-certificate/server.pem")/server.pem

echo Linking ${TARGET_LOCATION} TO ${SOURCE_LOCATION}
rm -f ${TARGET_LOCATION} || true
ln -s ${SOURCE_LOCATION} ${TARGET_LOCATION}
chmod 400 ${TARGET_LOCATION} # after 30 days create-react-app tries to generate a new certificate and overwrites the existing one. 
echo "Created server.pem symlink"

以上是关于sh 用于将工作证书链接到create-react-app的脚本。允许您使用create-react-app和有效的SSL证书。的主要内容,如果未能解决你的问题,请参考以下文章

SSL工作原理,SSL加密原理,SSL证书怎么加密

sh 将证书上载到AWS IAM以在Cloudfront中使用

sh 用于生成ssl证书#ssl的Bash脚本

sh 生成用于使用HTTPS运行Docker的可信CA证书

sh 这是一个shell脚本,用于自动生成https托管站点的自签名证书。

sh 一个将生成CA的脚本,将CA导入到钥匙串中,然后它将创建一个证书并与CA签名,然后将其导入到