[root@localhost ~]#systemctl stop firewalld
[root@localhost ~]#setenforce 0
[root@localhost ~]#iptables -F
[root@localhost ~]#yum -y install pcre zlib openssl openssl-devel pcre-devel zlib-devel
[root@localhost ~]#cd /usr/local/nginx-1.16.0
[root@localhost nginx-1.16.0]#./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_stub_status_module --with-http_ssl_module
[root@localhost ~]#make && make install
[root@localhost ~]#useradd -M -s /sbin/nologin nginx
[root@localhost ~]#ln -s /usr/local/nginx/sbin/nginx /usr/local/sbin
[root@localhost ~]#nginx
[root@localhost ~]# touch /etc/pki/CA/index.txt
[root@localhost ~]# echo 01 > /etc/pki/CA/serial
[root@localhost ~]# cd /etc/pki/CA/
[root@localhost CA]# umask 066
[root@localhost CA]# openssl genrsa -out /etc/pki/CA/private/cakey.pem 2048
[root@localhost ~]# openssl req -x509 -key /etc/pki/CA/private/cakey.pem -days 7300 -out /etc/pki/CA/cacert.pem
Country Name (2 letter code) [XX]:CN
State or Province Name (full name) []:BJ
Locality Name (eg, city) [Default City]:BJ
Organization Name (eg, company) [Default Company Ltd]:WXYC
Organizational Unit Name (eg, section) []:JSB
Common Name (eg, your name or your server's hostname) []:a.com
Email Address []:111111@sina.com

[root@localhost ~]# mkdir key
[root@localhost ~]# cd key/
[root@localhost key]# umask 066
[root@localhost key]# openssl genrsa -out service.key 2048
[root@localhost key]# openssl req -new -key service.key -out service.csr
Country Name (2 letter code) [XX]:CN
State or Province Name (full name) []:BJ
Locality Name (eg, city) [Default City]:BJ
Organization Name (eg, company) [Default Company Ltd]:WXYC
Organizational Unit Name (eg, section) []:JSB
Common Name (eg, your name or your server's hostname) []:a.com
Email Address []:111111@sina.com

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:

[root@localhost key]# mkdir /etc/pki/CA/csr
[root@localhost key]# mv service.csr /etc/pki/CA/csr
[root@localhost key]# openssl ca -in /etc/pki/CA/csr/service.csr -out /etc/pki/CA/certs/service.crt -days 365
Sign the certificate? [y/n]:y

1 out of 1 certificate requests certified, commit? [y/n]y

基于nginx结合openssl实现https的更多相关文章

  1. LInux基于nginx与OpenSSL实现https访问

    注意!!首先在nginx安装时添加--with-http_ssl_module模块,否则将会报错,只能从头开始了 自建证书: 通过openssl命令(软件包:openssl :openssl-deve ...

  2. 基于Nginx和openssl实现https

    [root@localhost ssl]# yum -y install openssl [root@localhost ssl]# mkdir /usr/local/nginx/conf/ssl/ ...

  3. 基于 Nginx 的 HTTPS 性能优化

    前言 分享一个卓见云的较多客户遇到HTTPS优化案例. 随着相关浏览器对HTTP协议的“不安全”.红色页面警告等严格措施的出台,以及向 iOS 应用的 ATS 要求和微信.支付宝小程序强制 HTTPS ...

  4. 基于 Nginx 的 HTTPS 性能优化实践

    前言 分享一个卓见云的较多客户遇到HTTPS优化案例. 随着相关浏览器对HTTP协议的“不安全”.红色页面警告等严格措施的出台,以及向 iOS 应用的 ATS 要求和微信.支付宝小程序强制 HTTPS ...

  5. 基于OpenSSL的HTTPS通信C++实现

      HTTPS是以安全为目标的HTTP通道,简单讲是HTTP的安全版.即HTTP下加入SSL层,HTTPS的安全基础是SSL,因此加密的详细内容就需要SSL.Nebula是一个为开发者提供一个快速开发 ...

  6. Centos7.2下Nginx配置SSL支持https访问(站点是基于.Net Core2.0开发的WebApi)

    准备工作 1.基于nginx部署好的站点(本文站点是基于.Net Core2.0开发的WebApi,有兴趣的同学可以跳http://www.cnblogs.com/GreedyL/p/7422796. ...

  7. windows下编译基于nginx插件的rtmp流媒体服务nginx-rtmp

    1 概述 rtmp流媒体服务器,开源方案有多种,包括srs,red5,crtmpserver,fms,nginx插件等.本文描述了基于nginx插件的方式来实现rtmp流媒体服务器nginx-rtmp ...

  8. Windows下Nginx配置SSL实现Https访问(包含证书生成)

    Vincent.李   Windows下Nginx配置SSL实现Https访问(包含证书生成) Windows下Nginx配置SSL实现Https访问(包含证书生成) 首先要说明为什么要实现https ...

  9. 基于Nginx dyups模块的站点动态上下线并实现简单服务治理

    简介 今天主要讨论一下,对于分布式服务,站点如何平滑的上下线问题. 分布式服务 在分布式服务下,我们会用nginx做负载均衡, 业务站点访问某服务站点的时候, 统一走nginx, 然后nginx根据一 ...

随机推荐

  1. -k 组合调用执行部分用例

    场景:只执行符合要求的某一部分用例,通过类与方法的命名实 现.通常编写测试方法时 • 解决:使用-k • pytest -k "TestClass and test_one" • ...

  2. 防止按钮重复点击的思路(js篇)

    最直接的思路可能就是点击按钮后,按钮的事件绑定函数解绑,1s后重新绑定函数 <button id=</button> <script> btn.onclick = fun ...

  3. CSS中的块级元素和行内元素

    根据CSS规范的规定,每一个网页元素都有一个display属性,用于确定该元素的类型,每一个元素都有默认的display属性值,比如div元素,它的默认display属性值为“block”,成为“块级 ...

  4. vue 使用pug(详细说明)

    1.安装pug npm i -D pug pug-html-loader pug-plain-loader cli2.0脚手架修改build/webpack.base.conf.js文件 module ...

  5. myEclipse 搭建 Spring boot+myBatis+maven 项目流程

    1.新建一个工程 new-->maven project-->next-->next-->在filter中搜索webapp-->group id.Artifact id- ...

  6. Light项目---实现后端接口时遇见的一些问题

    ImproperlyConfigured: WSGI application 'lightapi.wsgi.application' could not be loaded; 在moddleware中 ...

  7. Delphi如何获取一个字符串再另一个字符串中最后一次出现的位置

    uses StrUtils;   function ReversePos(SubStr, S: String): Integer; var   i : Integer; begin   i := Po ...

  8. Centos 更改语言设置为中文

    说明 自己装系统时一般都可以自定义选择系统语言.可是云端服务器一般都是安装好的镜像,默认系统语言为英文,对于初学者可能还会有搞不懂的计算机词汇.这里简单说一下centos7怎么修改系统语言为中文. 修 ...

  9. 屏幕尺寸,分辨率,PPI,像素之间的关系

    什么是屏幕尺寸? 华为荣耀7的尺寸是5.2英寸.这个5.2英寸是手机屏幕对角线的长度. 1英寸(inch)=2.54厘米(cm) 什么是分辨率? 华为荣耀7的分辨率是1920PX*1080PX.像素是 ...

  10. Android编程:解决异常“android.view.InflateException: Binary XML file line # : Error inflating class”

    今天写程序发现一个问题,就是XML中报出android.view.InflateException异常,可能的原因有: 1.XML中使用到得组件名称是否书写正确(包名+类名),可以使用crtl+鼠标点 ...