https搭建(openssl)
https搭建(openssl)(未成)
http://www.openssl.org/source/openssl-1.0.1.tar.gz
http://www.openssl.org/contrib/ssl.ca-0.1.tar.gz
# tar zxf openssl-1.0.1.tar.gz
# cd openssl-1.0.1
# ./config
# make && make install
制作证书
# tar zxvf ssl.ca-0.1.tar.gz
# cd ssl.ca-0.1
#./new-root-ca.sh (生成根证书)
No Root CA key round. Generating one
Generating RSA private key, 1024 bit long modulus
...........................++++++
....++++++
e is 65537 (0x10001)
Enter pass phrase for ca.key: (输入一个密码)
Verifying - Enter pass phrase for ca.key: (再输入一次密码)
......
Self-sign the root CA... (签署根证书)
Enter pass phrase for ca.key: (输入刚刚设置的密码)
........
........ (下面开始签署)
Country Name (2 letter code) [MY]:aa
State or Province Name (full name) [Perak]:aa
Locality Name (eg, city) [Sitiawan]:aa
Organization Name (eg, company) [My Directory Sdn Bhd]:aa
Organizational Unit Name (eg, section) [Certification Services Division]:aa
Common Name (eg, MD Root CA) []:aa
Email Address []:aa@126.com
这样就生成了ca.key和ca.crt两个文件,下面还要为我们的服务器生成一个证书:
# ./new-server-cert.sh server (这个证书的名字是server)
......
......
Country Name (2 letter code) [MY]:aa
State or Province Name (full name) [Perak]:aa
Locality Name (eg, city) [Sitiawan]:aa
Organization Name (eg, company) [My Directory Sdn Bhd]:aa
Organizational Unit Name (eg, section) [Secure Web Server]:aa
Common Name (eg, www.domain.com) []:localhost
Email Address []:aa@126.com
这样就生成了server.csr和server.key这两个文件。
还需要签署一下才能使用的:
# ./sign-server-cert.sh server
CA signing: server.csr -> server.crt:
Using configuration from ca.config
Enter pass phrase for ./ca.key: (输入上面设置的根证书密码)
Check that the request matches the signature
Signature ok
The Subject's Distinguished Name is as follows
countryName :PRINTABLE:'aa'
stateOrProvinceName :PRINTABLE:'aa'
localityName :PRINTABLE:'aa'
organizationName :PRINTABLE:'aa'
organizationalUnitName:PRINTABLE:'aa'
commonName :PRINTABLE:'localhost'
emailAddress :IA5STRING:'aa@126.com'
Certificate is to be certified until Jan 19 21:59:46 2011 GMT (365 days)
Sign the certificate? [y/n]:y
1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated
CA verifying: server.crt <-> CA cert
server.crt: OK
根据Apache的配置文件extra / httpd-ssl.conf 里面的设置,将证书放在适当的位置。默认是在conf目录下
# mv server.key /usr/local/apache/conf/
# mv server.crt /usr/local/apache/conf/
注:aa为随意写的
重新编译apache(添加enable-ssl参数)
# cd /usr/src/httpd-2.2.4
# ./configure --prefix=/usr/local/apache --enable-so --enable-mods-shared=all --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-ssl
# make && make install
# ls /usr/local/apache/modules (看有没有mod_ssl.so)
# vi /usr/local/apache/conf/httpd.conf
LoadModules ssl_module modules/mod_ssl.so
Include conf/extra/httpd-ssl.conf
:wq
# setenforce 0
# chcon -c -v -R -u system_u -r object_r -t textrel_shlib_t /usr/local/apache/modules/mod_ssl.so
# setenforce 1
# service httpd restart (需要执行2次)
# netstat -ntpl | grep 443
验证:https://192.168.1.10
注:https的网站目录在/usr/local/apache/conf/extra/httpd-ssl.conf中指定
本文转自linux博客51CTO博客,原文链接http://blog.51cto.com/yangzhiming/862905如需转载请自行联系原作者
yangzhimingg
https搭建(openssl)相关推荐
- 基于https搭建habor私有库
基于https搭建habor私有库 1.编辑/etc/docker/daemon.json文件,如果文件不存在,则新建该文件,在该文件中加入:"insecure-registries&quo ...
- fatal: unable to access ‘https://XXXXX‘: : OpenSSL SSL_read: Connection was reset, errno 10054……
fatal: unable to access 'https://XXXXX': : OpenSSL SSL_read: Connection was reset, errno 10054-- 解决办 ...
- ubuntu qt平台搭建openssl开发环境
ubuntu qt平台搭建openssl开发环境 1.下载解压 (这里以当前官网下载的最新版本为例,官网地址:http://www.openssl.org/source) tar -zxvf open ...
- docker Harbor2.3.4 https 搭建镜像仓库
文章目录 一.环境准备 1. 环境要求 2. 节点总览 3. 安装docker-compose 二.安装harbor 2.1. 下载 2.2. 解压 2.3. 认证 2.4. 调整配置 2.5. 安装 ...
- 使用certbot在nginx搭建HTTPS 以及 阿里云负载均衡HTTPS搭建
使用certbot在nginx搭建HTTPS certbot certbot官⽹ apache配置文档 安装证书自动工具 certbot yum install -y epel-release yum ...
- Nginx支持HTTPS,openssl生成SSL证书
./configure --prefix=/usr/local/nginx --with-http_ssl_module 1)创建SSL证书私钥,输入两次密码,生成文件为server.key open ...
- 微信小程序阿里云服务器https搭建
已更新 2018-11-20 1.什么是https? HTTPS(全称:安全套接字层上的超文本传输协议),是以安全为目标的HTTP通道,简单讲是HTTP的安全版.即HTTP下加入SSL层,HTTP ...
- ubuntu下搭建https web服务器
1.先安装openssl,可以直接到官网下载,传送门openssl官网, 也可以利用wget下载 命令:wget https://www.openssl.org/source/openssl-1.0. ...
- nginx上搭建https服务
参考链接:https://www.cnblogs.com/dreamingodd/p/7357029.html Https.OpenSSL自建CA证书及签发证书.nginx单向认证.双向认证及使用Ja ...
最新文章
- 微型计算机m3500q,拆分式一体机!联想ThinkCentre 超级Q 23
- Spring Boot 启动可以有多快?
- 川崎机器人总线通信_【川崎】川崎机器人PROFINET 总线通信图文教程(上)
- HTML--- 创建一个登录页面(HTML,CSS)
- ICEM特别卡顿,NVIDIA英伟达显卡问题,将集成处理器改成高性能即可【终极解决方案】
- 自定义UITabBar的背景图片或者颜色
- Mysql学习总结(69)——Mysql EXPLAIN 命令使用总结
- 软件 PRE、RC、beta、RTM、CTP等版本号的基本区别
- WebView load**方法 加载资源【总结】
- 使用 processon 画 UML 图
- idea 中代码大小写切换快捷键
- 校赛题解(部分)+反思
- Linux下ps -ef 和 ps aux 的区别及格式详解
- iOS12.3正式版不能更新是怎么回事(解决办法)
- arm汇编中DCB、DCW、DCD、DCQ指令
- 自己做量化交易软件(44)小白量化实战17--利用小白量化金融模块在迅投QMT极速策略交易系统上仿大智慧指标回测及实战交易设计
- 【C语言】杨辉三角(数组)
- 【杂谈】Remember-Me的实现
- 我的目标在哪里——一个程序员的规划
- 反常积分(如何解题)