创建csr证书用于SSL

1.先创建一个RSA私钥

sudo openssl genrsa -out private.key 2048

输出得到一个private.key的文件,里面的字符串就是你的私钥

2.然后创建csr证书

sudo openssl req -new -key private.key -out csr.pem

这个会要求你一步一步来根据提示输入,我列一下

  • 第一步是
Country Name (2 letter code) [XX]:

我输入US

  • 第二步是
State or Province Name (full name) []:

我输入California

  • 第三步是
Locality Name (eg, city) [Default City]:

我输入Cupertino

  • 第四步是
Organization Name (eg, company) [Default Company Ltd]:

我输入GPTChat

  • 第五步是
Organizational Unit Name (eg, section) []:

我输入GPT

  • 第六步是
Common Name (eg, your name or your server's hostname) []:

我输入duoduo.college 这一步很关键,这是域名

  • 第七步是
Email Address []:

我输入[email protected]

  • 第八步是
A challenge password []:

我留空了

  • 第九步是
An optional company name []:

我输入ChatGPT

到此创建完毕,查看当前目录下应该有csr.pem private.key文件

猜你喜欢

转载自blog.csdn.net/u013538542/article/details/131248423