当前位置:网站首页>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边栏推荐
猜你喜欢
随机推荐
Webrtc从理论到实践三:角色
PyTorch Study Notes 08 - Loading Datasets
自动化测试之unittest框架
Webrtc从理论到实践二: 架构
【Rhapsody学习笔记】2:Count Down
CSDN上markdown编写的一些便捷操作
【Rhapsody学习笔记】1:Hello World
实现离线文件推流成rtsp 2
nacos1.4.1创建配置报错
Learning and understanding of ROS service programming
Remote file xxx is mapped to the local path xxx and can‘t be found. You can continue debugging....
Webrtc从理论到实践一:初识
ES6-新增的基本数据:Symbol
ES6-03-解构赋值
IDEA overview and installation and debugging
在 AWS 上从零开始设置 Incredibuild 构建系统
三本毕业,中途转行软件测试,顶着这些光环从月薪7k干到20k+,感觉还不错
解决background-size:cover时图片铺满但显示不完整?
滑动窗口法
911崩了,自养号测评环境IP有哪些更好的选择









