当前位置:网站首页>Openssl一键自签证书
Openssl一键自签证书
2022-07-31 05:19:00 【wdhqwe520】
#!/bin/bash
while [[ -z "$domain" ]];do
read -p "输入域名/IP(必填,如 *.haoduck.com): " domain
done
read -p "输入邮箱(选填,默认[email protected]): " mail
[[ -z "$mail" ]] && [email protected]
read -p "输入日期(选填,默认3650): " day
[[ -z "$day" ]] && day=3650
dir=$domain && mkdir -p $dir
crt_file="$dir/${domain}.crt"
key_file="$dir/${domain}.key"
if [[ "$(command -v openssl)" ]];then
openssl req -x509 -nodes -newkey rsa:2048 -days $day -keyout $key_file -out $crt_file -subj "/C=US/ST=California/L=Los Angeles/O=Haoduck/OU=Aoao/CN=${domain}/emailAddress=${mail}"
echo -e "\t证书:$(pwd)/$crt_file\n\t私钥:$(pwd)/$key_file"
else
echo "openssl 未安装"
fi边栏推荐
猜你喜欢
随机推荐
DingTalk H5 micro-app login authentication
力扣.剑指offer05.替换空格
ES6-class类
【Rhapsody学习笔记】2:Count Down
力扣.找到打字符串中所有字母异位词
ES6-数组
数据驱动,
解决nx安装 jtop问题
TCP与UDP协议的区别,以及TCP的三次握手和四次挥手
【Rhapsody学习笔记】3:Dishwasher
Remote file xxx is mapped to the local path xxx and can‘t be found. You can continue debugging....
等待,信息打印,浏览器操作,键盘事件
Where can I find the private files set by myself?
5G的用途和工作原理
【Rhapsody学习笔记】4:Relations
IDEA概述和安装及调试
PyTorch Study Notes 08 - Loading Datasets
2021-09-30
概率论相关笔记
ES6-Map、Set与Arrary的转换









