原创文章,转载请注明出处:server非业余研究http://blog.csdn.net/erlib 作者Sunface


假设仅为了測试,那使用以下方法就可以:

測试证书创建:

1.创建证书的key

  1. $ openssl genrsa -out key.pem 1024

2.创建证书,注意这里的common name应该填你的server name

  1. $ openssl req -new -key key.pem -out request.pem
  2. Country Name (2 letter code) [AU]:UA
  3. State or Province Name (full name) [Some-State]:
  4. Locality Name (eg, city) []:Kiev
  5. Organization Name (eg, company) [Internet Widgits Pty Ltd]:site4fast blog
  6. Organizational Unit Name (eg, section) []:.
  7. Common Name (eg, YOUR name) []:site4fast.example.net
  8. Email Address []:site4fast@example.net
  9. Please enter the following 'extra' attributes
  10. to be sent with your certificate request
  11. A challenge password []:
  12. An optional company name []:

3.证书签字

  1. $ openssl x509 -req -days 30 -in request.pem -signkey key.pem -out certificate.pem

4.至此,我们须要的測试证书已经创建好了:"self-signed certificate".

正式的证书创建步骤:

1.安装CA证书

  1. $ aptitude install ssl-cert ca-certificates

2.在startssl.com注冊

3.创建一个请求
  1. $ openssl req -new -newkey rsa:2048 -nodes -keyout www_privatekey.pem -out www_csr.pem
  1. Generating a 2048 bit RSA private key
  2. ..................................++++++
  3. ....................++++++
  4. writing new private key to 'www_privatekey.pem'
  5. -----
  6. You are about to be asked to enter information that will be incorporated
  7. into your certificate request.
  8. What you are about to enter is what is called a Distinguished Name or a DN.
  9. There are quite a few fields but you can leave some blank
  10. For some fields there will be a default value,
  11. If you enter '.', the field will be left blank.
  12. -----
  13. Country Name (2 letter code) [AU]:UA
  14. State or Province Name (full name) [Some-State]:Some state
  15. Locality Name (eg, city) []:Some City
  16. Organization Name (eg, company) [Internet Widgits Pty Ltd]:Some Organisation
  17. Organizational Unit Name (eg, section) []:IT
  18. Common Name (eg, YOUR name) []:www.example.org
  19. Email Address []:test@example.org
  20. Please enter the following 'extra' attributes
  21. to be sent with your certificate request
  22. A challenge password []:
  23. An optional company name []:

4.在发送之前验证请求的内容

  1. $ openssl req -in www_csr.pem -text -verify -noout

5.将请求发送给startssl.com,从站点请求一个新的证书。当须要CSR的时候将'www_csr.pem'填进去

6.从网页上复制证书。然后放入'www_certificate.pem'文件,然后检查文件的内容:
  1. $ openssl x509 -in www_certificate.pem -text -noout

7.測试server证书

  1. $ openssl verify www_certificate.pem

假设都正确。那就会看到OK的提示

  1. www_certificate.pem: OK

怎样获取自己的SSL证书的更多相关文章

  1. 阿里云和腾讯云免费SSL证书 专题

    阿里云部署SSL证书 http://www.cnblogs.com/sslwork/p/5984167.html 查找中间证书 为了确保兼容到所有浏览器,我们必须在阿里云上部署中间证书,如果不部署证书 ...

  2. 实战申请Let's Encrypt永久免费SSL证书过程教程及常见问题

    最近需要https这里看到一份不错的博客,收录一下! Let's Encrypt作为一个公共且免费SSL的项目逐渐被广大用户传播和使用,是由Mozilla.Cisco.Akamai.IdenTrust ...

  3. 申请Let’s Encrypt永久免费SSL证书过程教程及常见问题

    配置证书https://easy.zhetao.com/   虽然目前Let’s Encrypt免费SSL证书默认是90天有效期,但是我们也可以到期自动续约,不影响我们的尝试和使用,为了考虑到文章的真 ...

  4. 转载免费的SSL证书

    目前我知道的有2种方式进行免费的SSL证书的获取 第一种:腾讯云申请 第二种:Let's Encrypt (国外在) 我一直使用第一种,还可以,有效期1年. 以下转载第二种: 实战申请Let's En ...

  5. ubuntu20.04 apache2 配置安装ssl证书

    1. 获取SSL证书 根据自己的网站服务器来获取不同的ssl证书,我的服务器是ubuntu20.04. 证书如下: 00_***.key ## 私钥文件 01_CERTIFICATE_***_***. ...

  6. centos7利用acme.sh获取Let's Encrypt的永久免费ssl证书并配置网站域名https访问

    acme.sh介绍:https://github.com/Neilpang/acme.sh/wiki/%E8%AF%B4%E6%98%8E github:https://github.com/Neil ...

  7. Let’s Encrypt Wildcard 免费泛域名SSL证书获取安装

    2018 年 1 月Let’s Encrypt CA 宣布免费提供通配符证书(Wildcard certificate).通配符证书是一种可被多个子域使用的公钥证书.这意味着,单个证书可用于提供多台服 ...

  8. docker获取Let's Encrypt永久免费SSL证书

    一 起因 官方的cerbot太烦了,不建议使用 还不如野蛮生长的acme.sh,而这里介绍docker运行cerbot获取Let's Encrypt永久免费SSL证书 二 选型 cerbot的证书不会 ...

  9. ubuntu 下获取Let's Encrypt免费ssl证书

    # ubuntu 下获取Let's Encrypt免费ssl证书 # 一.安装Nginx https://www.cnblogs.com/watermeloncode/p/15476317.html ...

随机推荐

  1. POJ 2455 网络流 基础题 二分+网络流 dicnic 以及 sap算法

    Secret Milking Machine Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 8189   Accepted: ...

  2. 怎样在android实现uc和墨迹天气那样的左右拖动效果

    import android.app.Activity; import android.os.Bundle; import android.content.Context; import androi ...

  3. Android 它们的定义View它BounceProgressBar

    转载请注明出处:http://blog.csdn.net/bbld_/article/details/41246247 [Rocko's blog] 之前几天下载了非常久没用了的桌面版酷狗来用用的时候 ...

  4. ADO.NET 2SqlDataAdapter、DataSet 的基本用法

    数据集完全独立于数据源,可以与数据源链接或者完全断开,其基本作用是为存储在内存缓存中的的数据提供关系视图 如果只是想读取和显示数据,则值需要使用数据读取器,尤其是处理大量数据的时候 如果需要处理数据, ...

  5. Windows Phone 9再见了!

    因为需要准备注册电气工程师考试,因此Windows Phone 8初学者教程的翻译只能就此打住了,在考完后,也许就是Windows Phone 9发布的时候还会回来! Bye bye!

  6. tomcat加载时报The web application [/dmscs] created a ThreadLocal with key of type

    严重: The web application [/dmscs] created a ThreadLocal with key of type [com.opensymphony.xwork2.inj ...

  7. vs2010中将复制过来的文件或文件夹显示到解决方案管理

    今天在给一个做好的页面上加.net程序,我先将程序中的文件夹复制到解决方案中,可是在VS2010的解决方案资源管理器中并没有这样的文件夹,可明明 在这里,为什么显示不出来,应该在VS2010的哪个地方 ...

  8. CSS未知div高度垂直居中代码_层和布局特效

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  9. 在Python中使用正则表达式同时匹配邮箱和电话并进行简单的分类

    在Python使用正则表达式需要使用re(regular exprssion)模块,使用正则表达式的难点就在于如何写好p=re.compile(r' 正则表达式')的内容. 下面是在Python中使用 ...

  10. uva 10692 - Huge Mods(数论)

    题目链接:uva 10692 - Huge Mods 题目大意:给出一个数的次方形式,就它模掉M的值. 解题思路:依据剩余系的性质,最后一定是行成周期的,所以就有ab=abmod(phi[M])+ph ...