SSL虚拟证书

本文深入探讨SSL(Secure Socket Layer)虚拟证书的工作原理、重要性以及如何在网站上部署和管理。SSL证书用于建立安全的加密连接,保护用户数据不被窃取,提升网站信誉。了解SSL证书的验证级别,包括域名验证、组织验证和扩展验证,以及它们在不同场景下的适用性。
摘要由CSDN通过智能技术生成
[root@localhost ~]# cd /opt/data/nginx/conf/conf.d/
[root@localhost conf.d]#
[root@localhost conf.d]# openssl genrsa -des3 -out server.key 1024
Generating RSA private key, 1024 bit long modulus
.........++++++
.....++++++
e is 65537 (0x10001)
Enter pass phrase for server.key:
Verifying - Enter pass phrase for server.key:
[root@localhost conf.d]#
[root@localhost conf.d]# openssl req -new -key server.key -out server.csr
Enter pass phrase for server.key:
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:cn
State or Province Name (full name) []:Shannxi
Locality Name (eg, city) [Default City]:Baoji
Organization Name (eg, company) [Default Company Ltd]:jianan
Organizational Unit Name (eg, section) []:xc
Common Name (eg, your name or your server's hostname) []:we
Email Address []:

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
You have new mail in /var/spool/mail/root
[root@localhost conf.d]#
[root@localhost conf.d]# cp server.key server.key.org
[root@localhost conf.d]#
[root@localhost conf.d]# openssl rsa -in server.key.org -out server.key
Enter pass phrase for server.key.org:
writing RSA key
[root@localhost conf.d]# 
[root@localhost conf.d]# openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
Signature ok
subject=/C=cn/ST=Shannxi/L=Baoji/O=jianan/OU=xc/CN=we
Getting Private key
[root@localhost conf.d]# ls
anttech.conf  server.csr  server.key.org  xingyun.conf
server.crt    server.key  xing_yun.conf
[root@localhost conf.d]# 
[root@localhost conf.d]# vi xing_yun.conf
[root@localhost conf.d]# more xing_yun.conf
server {
    server_name www.xingyun.com;
    listen 443;
    ssl on;
    ssl_certificate /opt/data/nginx/conf/conf.d/server.crt;
    ssl_certificate_key /opt/data/nginx/conf/conf.d/server.key;

    location / {
        root    /data/xingyun/basic;
        index index.html index.htm;
     }
}
[root@localhost conf.d]#
[root@localhost conf.d]# systemctl start nginx
[root@localhost conf.d]#

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值