当前位置:网站首页>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边栏推荐
猜你喜欢

力扣151. 颠倒字符串中的单词

TCP与UDP协议的区别,以及TCP的三次握手和四次挥手

Remote file xxx is mapped to the local path xxx and can‘t be found. You can continue debugging....

Incredibuild 宣布支持 Yocto

C语言对文件的操作(完整版)

DOM操作-案例:切换背景图片

Qt TreeView 问题记录

Pytorch Daily Practice - Predicting Surviving Passengers on the Titanic

【Rhapsody学习笔记】2:Count Down

钉钉企业内部-H5微应用开发
随机推荐
2021-09-30
对称加密和非对称加密
力扣.字母异位词分组
file和stat命令的使用,文件类型:代表字符,以及英文
测试——用例篇
Unity转微信小游戏与JS交互
【内网开发日记】用websocket手搓一个聊天软件
UR3机器人雅克比矩阵
软件测试之登录测试详解
Unity导入我的世界模型,简单图解教程(包括调整材质贴图和光照和添加碰撞)
Pytorch study notes 10 - detailed explanation of convolutional neural network and application of multi-classification task of mnist dataset
Virtual machine view port number process
【Rhapsody学习笔记】4:Relations
ImportError: cannot import name ‘Xxxx‘ from partially initialized module ‘xx.xx.xx‘
力扣刷题之排序链表
解决background-size:cover时图片铺满但显示不完整?
Pytorch study notes 13 - Basic_RNN
MySQL free installation download and configuration tutorial
通过js禁止ctrl+滚轮放缩浏览器页面,禁止用手势放大
十分钟教你玩转分支语句!!!!!小白速进,新手福利!!