MacOS Localhost自签名证书

2022-08-06

以下示例是关于Whatever中包含MacOS Localhost自签名证书用法的示例代码,想了解MacOS Localhost自签名证书的具体用法?MacOS Localhost自签名证书怎么用?MacOS Localhost自签名证书使用的例子?那么可以参考以下相关源代码片段来学习它的具体使用方法。

[英]:macos localhost self signed certificate源码类型:Whatever
cd /usr/local/etc/httpd/extra/cert
sudo openssl genrsa -out ./localhost.key 2048
sudo openssl rsa -in ./localhost.key -out ./localhost.key.rsa
sudo openssl req -new -key ./localhost.key.rsa -subj "/C=ar/ST=caba/L=caba/O=localhost/CN=localhost/" -out ./localhost.csr -config ./localhost.conf
sudo openssl x509 -req -extensions v3_req -days 365 -in ./localhost.csr -signkey ./localhost.key.rsa -out ./localhost.crt -extfile ./localhost.conf
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ./localhost.crt

本文地址:https://www.itbaoku.cn/snippets/795584.html