sh 成为您自己的证书颁发机构

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 成为您自己的证书颁发机构相关的知识,希望对你有一定的参考价值。

# Kudos to https://datacenteroverlords.com/2012/03/01/creating-your-own-ssl-certificate-authority/

# Create the Root Key (the Certificate Authority Key)
# Trust this key on your devices and browsers to avoid the security warning when using the signed certificates.

# The first step is to create the private root key which only takes one step.
# In the example below, I’m creating a 2048 bit key:
openssl genrsa -out rootCA-key.pem 2048
# The next step is to self-sign this certificate.
openssl req -x509 -new -nodes -key rootCA-key.pem -sha256 -days 1024 -out rootCA-crt.pem


# Create and sign certificates to use on your servers.

# Save the domain name to use on a variable
export CERT_DOMAIN="*.fomfus.com"
# Just like with the root CA step, you’ll need to create a private key (different from the root CA).
openssl genrsa -out device-key.pem 2048
# Once the key is created, you’ll generate the certificate signing request.
openssl req -new -key device-key.pem -out device-crt.pem -subj /CN="$CERT_DOMAIN"
# Once that’s done, you’ll sign the CSR with your CA root key.
openssl x509 -req -in device-crt.pem -CA rootCA-crt.pem -CAkey rootCA-key.pem -CAcreateserial -out device-crt.pem -days 500 -sha256 \
    -extensions SAN \
    -extfile <(cat /private/etc/ssl/openssl.cnf \
        <(printf '[SAN]\nsubjectAltName=DNS:%s' "$CERT_DOMAIN"))

以上是关于sh 成为您自己的证书颁发机构的主要内容,如果未能解决你的问题,请参考以下文章

sh 为与您拥有证书颁发机构的开发站点轻松创建本地SSL证书https://deliciousbrains.com/ssl-cert

借助makecert.exe让自己成为CA提供商

将新的受信任 CA 添加到 Azure 上的证书颁发机构证书存储区

证书颁发机构CA干啥用,啥时候要用这个

CA机构介绍(Certificate Authority 域名SSL证书颁发机构)

SSL证书主流机构汇总