`

HTTPS-SSL证书CSR CRT生成

Web 
阅读更多

Home

Start off in your home directory and create a temporary folder so we can work from one place and not have files scattered all over the shop:

mkdir /home/demo/temp
...
cd /home/demo/temp

Key

First we need to create a private key. Note that this processwillrequire a passphrase for the key - don't worry, we'll remove it later to make things easier:

openssl genrsa -des3 -out myssl.key 1024

As said, this will require you to enter a passphrase.

CSR

Now we need to create a CSR (Certificate Signing Request):

openssl req -new -key myssl.key -out myssl.csr

The process will ask for various details for the certificate. I entered the following for each question:

Country Name: GB

State or Province Name: Nottinghamshire

Locality Name: Nottingham

Organization Name: PickledOnion Ltd

Organizational Unit Name: Web Development

Common Name: admin.domain.com

Email Address: webadmin@domain.com

For the 'extra' attributes I simply pressed 'return' (i.e. I left them blank).

Note: For the Common Name I entered the domain name I want to associate with the certificate. In this case I want it for my administration area so I entered 'admin.domain.com'.

You are not restricted to using the certificate with just that domain but it will produce extra warnings if the Common Name does not match the URI.

Remove Passphrase

When we generated the myssl.key file, we had to enter a passphrase. One disadvantage of this is the need to enter the passphrase if the Slice is rebooted.

This is especially problematic if an unexpected reboot occurs as the boot sequence will simply stop until you enter the console via the SliceManager and enter it.

So unless you see a particular need to keep the passphrase, let's remove it:

cp myssl.key myssl.key.org
openssl rsa -in myssl.key.org -out myssl.key

You will be asked for the passphrase one last time to confirm it is a genuine request.

Now we have three files in the temp folder:

ls
...
myssl.csr  myssl.key  myssl.key.org

CRT

The last file we need generate is the actual ssl certificate:

openssl x509 -req -days 365 -in myssl.csr -signkey myssl.key -out myssl.crt

Good. Now we have the final piece in place as that generated our myssl.crt file.

 

分享到:
评论

相关推荐

    CentOS Apache SSL Configuration

    在生成自签证书之前,需要使用 OpenSSL 工具来生成私钥和证书签名请求(CSR)。打开终端,输入以下命令: `openssl genrsa -out ca.key 1024` 这将生成一个 1024 位的私钥文件 ca.key。 接下来,生成证书签名请求...

    Nginx搭建https服务器1

    Nginx搭建https服务器 Nginx是一款流行的开源Web服务器软件,它...搭建HTTPS服务器需要我们了解SSL/TLS协议、证书的生成和Nginx的配置。这篇文章旨在帮助读者快速地搭建HTTPS服务器,保护用户的数据免受中间人的攻击。

    Nginx实现https网站配置代码实例

    咱们直接linux下生成 假设nginx目录为 /usr/local/nginx-1.2.9 接下来 cd /usr/local/nginx-1.2.9/conf/; mkdir ssl; cd ssl; #下面开始创建密钥.如果不熟悉完全不必理会为什么这么做照做就可以了 openssl genrsa -...

    Nginx配置SSL自签名证书的方法

    生成自签名SSL证书 生成RSA密钥(过程需要设置一个密码,记住这个密码) $ openssl genrsa -des3 -out domain.key 1024 拷贝一个不需要输入密码的密钥文件 $ openssl rsa -in domain.key -out domain_nopass.key ...

    jks证书格式转换nginx使用格式

    alias:生成证书CSR时,所起的Alias别名 exportname:准备导出的文件名称 (不要带扩展名) JKS2PFX.bat d:\lgy.com.keystore 123456 lgy.com exportfile 该命令将server.jks中别名为lgy.com的SSL证书导出,运行后将...

    http.https:在同一端口上服务HTTP和HTTPS

    请注意,您将需要SSL证书来运行这些示例。 可以生成临时的自签名证书,如下所示: cd examples openssl genrsa -out example.key 2048 openssl req -new -out example.csr -key example.key openssl x509 -req -...

    OpenVaccineServer:开源恶意软件签名数据库服务器

    第2步:生成CSR(证书签名请求) $ openssl req-新-key server.key -out server.csr 第3步:从密钥中删除密码短语 $ cp server.key server.key.org $ openssl rsa -in server.key.org -out server.key 步骤4:...

    functions.events:贡献职能Conf

    功能会议网站地方发展要在本地运行,请首先生成供本地使用的SSL证书: cd sslopenssl genrsa -out root.key 2048openssl req -x509 -new -nodes -days 3650 -config openssl.cnf -key root.key -out root.pemopenssl...

    ansible-nginx:Nginx 的 Ansible 角色

    ssl_key - 用于生成与此站点有关的 SSL 证书的 CSR 和证书的 ssl 密钥的路径 ssl_crt - 根域 ssl 证书的路径 ssl_wildcard_crt - 通配符子域 ssl 证书的路径 app_env - 传递给 PHP 应用程序的 APPENV 环境变量 PHP ...

    home-asterisk-config:用于家庭电话服务的简单星号配置

    星号配置用于家庭电话服务的简单星号配置如何生成密钥和证书openssl genrsa -out config/asterisk.key 4096创建两个CSR。 请注意,这是创建CSR的标准沼泽方式,但它也遵循Asterisk书籍SSL章节中的指示。 我不确定...

    Nginx配置并兼容HTTP实现代码解析

    配置 HTTPS 要用到私钥 example.key 文件和 example.crt 证书文件,申请证书文件的时候要用到 example.csr 文件,OpenSSL 命令可以生成 example.key 文件和 example.csr 证书文件。 CSR:Cerificate Signing Request...

    搭建Harbor镜像仓库:从安装到上传镜像

    生成证书请求 (CSR): ``` openssl req -new -key /etc/pki/tls/private/key.key -out /etc/pki/tls/certificate/request.csr ``` 生成自签名证书: ``` openssl x509 -req -days 365 -in /etc/pki/tls/certificate/...

    sbuca:简单但有用的证书颁发机构

    在开发时,为 SSL/TLS 使用生成证书总是很痛苦。 sbuca是一个简单的 CA,可帮助您以无痛的方式生成您所需要的内容。 目前的特点: 生成 rsa 密钥(无需连接服务器) 生成认证请求(无需连接服务器) 向sbuca CA...

    HTTPS工作流程 传输协议、加密算法

    "HTTPS工作流程传输协议、加密算法" HTTPS是应用层协议,实际上是...csr是证书签名请求文件(公钥),用于提交给证书颁发机构(CA)对证书签名;crt是由证书颁发机构(CA)签名后的证书,或者是开发者自签名的证书。

    openssl生成器.rar

    绿色版 速度快 免安装,免去复杂的window安装步骤,直接运行,命令行快速生成*.key,*.csr,*.crt等文件,亲测绝对好用

    Postgre SQL数据库安全防护.pptx

    * SSL/TLS 客户端配置:在客户端,需要生成三个文件:postgresql.key (private key)、postgresql.crt (client certificate) 和 postgresql.csr (certificate signing request)。 三、Postgre SQL 数据库安全配置 *...

Global site tag (gtag.js) - Google Analytics