MariaDB:SSL配置
参考文章:https://blog.csdn.net/johnhill_/article/details/72831932 ,谢谢!
1.安装openssl
下载地址:http://slproweb.com/products/Win32OpenSSL.html
注意:安装完成后,记得配置系统path路径,指到bin目录。
具体路径请根据个人实际情况调整。
在cmd中,输入openssl,看到下图说明成功!
2.添加SSL支持
执行:
show variables like '%ssl%';
如果have_ssl不等于yes,说明还没有支持SSL。
添加SSL支持,打开my.ini文件:
[mysqld]
datadir=D:/app/MariaDB 10.3/data
port=3306
innodb_buffer_pool_size=511M
character-set-server=utf8
event_scheduler=ON
max_connections=1000
ssl
ssl-ca=D:/cert/ca-cert.pem
ssl-cert=D:/cert/server-cert.pem
ssl-key=D:/cert/server-key.pem
[client]
port=3306
plugin-dir=D:/app/MariaDB 10.3/lib/plugin
只需要添加标红行,重启mariadb服务就行。
重启之后再次执行看看have_ssl是否等于yes:
show variables like '%ssl%';
3.建立cert目录
D:\>mkdir cert
D:\>cd cert
4.配置证书
###为注释,蓝色是执行脚本,之下是执行结果。
###CA 私钥
D:\cert>openssl genrsa 2048 > ca-key.pem
Generating RSA private key, 2048 bit long modulus
.........+++++
................................................................................
................................................................................
.........................................................+++++
e is 65537 (0x010001) ###数字证书
D:\cert>openssl req -sha1 -new -x509 -nodes -days 3650 -key ca-key.pem > ca-cert.pem
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) [AU]:CN
State or Province Name (full name) [Some-State]:CN
Locality Name (eg, city) []:CN
Organization Name (eg, company) [Internet Widgits Pty Ltd]:test
Organizational Unit Name (eg, section) []:COM
Common Name (e.g. server FQDN or YOUR name) []:test.COM
Email Address []:test@test.COM ###服务器端的证书请求文件,A challenge password必须为空
D:\cert>openssl req -sha1 -newkey rsa:2048 -days 3650 -nodes -keyout server-key.pem > server-req.pem
Generating a 2048 bit RSA private key
................................................................................
+++++
.....+++++
writing new private key to 'server-key.pem'
-----
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) [AU]:CN
State or Province Name (full name) [Some-State]:CN
Locality Name (eg, city) []:CN
Organization Name (eg, company) [Internet Widgits Pty Ltd]:test
Organizational Unit Name (eg, section) []:COM
Common Name (e.g. server FQDN or YOUR name) []:test.COM
Email Address []:test@test.COM Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:test.COM ###服务器端的RSA私钥
D:\cert>openssl rsa -in server-key.pem -out server-key.pem
writing RSA key ###服务器端的数字证书
D:\cert>openssl x509 -sha1 -req -in server-req.pem -days 3650 -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 > server-cert.pem
Signature ok
subject=C = CN, ST = CN, L = CN, O = test, OU = COM, CN = test.COM, emailAddre
ss = test@test.COM
Getting CA Private Key ###客户端的证书请求文件,A challenge password必须为空
D:\cert>openssl req -sha1 -newkey rsa:2048 -days 3650 -nodes -keyout client-key.pem > client-req.pem
Generating a 2048 bit RSA private key
.................+++++
.......................................+++++
writing new private key to 'client-key.pem'
-----
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) [AU]:CN
State or Province Name (full name) [Some-State]:CN
Locality Name (eg, city) []:CN
Organization Name (eg, company) [Internet Widgits Pty Ltd]:test
Organizational Unit Name (eg, section) []:COM
Common Name (e.g. server FQDN or YOUR name) []:test.COM
Email Address []:test@test.COM Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []: ###客户端的RSA私钥:
D:\cert>openssl rsa -in client-key.pem -out client-key.pem
writing RSA key ###客户端的数字证书
D:\cert>openssl x509 -sha1 -req -in client-req.pem -days 3650 -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 > client-cert.pem
Signature ok
subject=C = CN, ST = CN, L = CN, O = test, OU = COM, CN = test.COM, emailAddre
ss = test@test.COM
Getting CA Private Key
5.在my.ini中配置证书
[mysqld]
datadir=D:/app/MariaDB 10.3/data
port=3306
innodb_buffer_pool_size=511M
character-set-server=utf8
event_scheduler=ON
max_connections=1000
ssl
ssl-ca=D:/cert/ca-cert.pem
ssl-cert=D:/cert/server-cert.pem
ssl-key=D:/cert/server-key.pem
[client]
port=3306
plugin-dir=D:/app/MariaDB 10.3/lib/plugin
只需要添加标红行,重启mariadb服务就行。再次执行
show variables like '%ssl%';
返回结果:
文件说明
ca-cert.pem: CA 证书, 用于生成服务器端/客户端的数字证书.
ca-key.pem: CA 私钥, 用于生成服务器端/客户端的数字证书.
server-key.pem: 服务器端的 RSA 私钥
server-req.pem: 服务器端的证书请求文件, 用于生成服务器端的数字证书.
server-cert.pem: 服务器端的数字证书.
client-key.pem: 客户端的 RSA 私钥
client-req.pem: 客户端的证书请求文件, 用于生成客户端的数字证书.
client-cert.pem: 客户端的数字证书.
MariaDB:SSL配置的更多相关文章
- 百度CDN 网站SSL 配置
百度CDN SSL配置步骤 一般从SSL提供商购买到的证书是CRT二进制格式的. 1. 将 CRT 导入到IIS中, 然后从IIS中导出为PFX格式 2. 下载openssl,执行下面命令 提取用户证 ...
- Nginx SSL配置过程
1. 在godaddy购买了UCC SSL(最多5个域名)的SSL证书 2. 设置证书 -- 管理 -- 3. 需要制作证书申请CSR文件(在线工具制作或者openssl命令制作),保存CSR和key ...
- ssl配置
Apache SSL配置 作者: JeremyWei | 可以转载, 但必须以超链接形式标明文章原始出处和作者信息及版权声明网址: http://weizhifeng.net/apache-ssl.h ...
- SSL 通信原理及Tomcat SSL 配置
SSL 通信原理及Tomcat SSL 双向配置 目录1 参考资料 .................................................................. ...
- nginx反向代理cas server之1:多个cas server负载均衡配置以及ssl配置
系统环境采用centOS7 由于cas server不支持session持久化方式的共享,所以请用其他方式代替,例如:组播复制. 为什么不支持session持久化:http://blog.csdn.n ...
- centos7邮件服务器SSL配置
在上篇文章centos7搭建postfix邮件服务器的搭建中我们没有配置SSL,接下来我们在这篇文章中讲讲centos7邮件服务器SSL配置. 1. 创建SSL证书 [root@www ~]# cd ...
- 基于【CentOS-7+ Ambari 2.7.0 + HDP 3.0】搭建HAWQ数据仓库 —— MariaDB 安装配置
一.安装并使用MariaDB作为Ambari.Hive.Hue的存储数据库. yum install mariadb-server mariadb 启动.查看状态,检查mariadb是否成功安装 sy ...
- Sahi (2) —— https/SSL配置(102 Tutorial)
Sahi (2) -- https/SSL配置(102 Tutorial) jvm版本: 1.8.0_65 sahi版本: Sahi Pro 6.1.0 参考来源: Sahi官网 Sahi Quick ...
- Nginx SSL配置
一.SSL 原理 ① 客户端( 浏览器 )发送一个 https 请求给服务器② 服务器要有一套证书,其实就是公钥和私钥,这套证书可以自己生成,也可以向组织申请,服务器会把公钥传输给客户端③ 客户端收到 ...
- Tomcat服务器配置https协议(Tomcat HTTPS/SSL 配置)
通常商用服务器使用https协议需要申请SSL证书,证书都是收费的,价格有贵的有便宜的.它们的区别是发行证书的机构不同,贵的证书机构更权威,证书被浏览器否决的几率更小. 非商业版本可以通过keytoo ...
随机推荐
- 必须掌握的MySQL优化指南
当 MySQL 单表记录数过大时,增删改查性能都会急剧下降,本文会提供一些优化参考,大家可以参考以下步骤来优化. 单表优化 除非单表数据未来会一直不断上涨,否则不要一开始就考虑拆分,拆分会带来逻辑.部 ...
- 利用CocoaHttpServer搭建手机本地服务器
原理 使用CocoaHTTPServer框架,在iOS端建立一个本地服务器,只要电脑和手机连入同一热点或者说网络,就可以实现通过电脑浏览器访问iOS服务器的页面,利用POST实现文件的上传. 实现 1 ...
- locust安装及其简单使用----基于python的性能测试工具
1.已安装python3.6 ,安装步骤略 pip安装: pip install locust 检查locust是否安装成功 locust --help 2.安装 pyzmq If you inten ...
- CodeForces 1151C Problem for Nazar
题目链接:http://codeforces.com/problemset/problem/1151/C 题目大意: 有一个只存奇数的集合A = {1, 3, 5……2*n - 1,……},和只存偶数 ...
- Linux--主从复制
一 . mysql+centos7 mariadb mariadb其实是跟mysql是一样的,只不过是在centos7上叫做mariadb, 主要是因为mysql被甲骨文公司收购后,可能会有闭源的风险 ...
- Manacher算法详解
问题 什么是回文串,如果一个字符串正着度读和反着读是一样的,这个字符串就被称为回文串. such as noon level aaa bbb 既然有了回文,那就要有关于回文的问题,于是就有了-- 最长 ...
- 02Lua入门
前言: 语言学起来其实相似点很多,简单整理的知识点 目录: 1.使用控制台 2.Lua基础 3.变量 4.运算符 5.控制结构 1.使用控制台 Lua脚本是包含一系列Lua命令的简单脚本(扩展名为.l ...
- [NOIp2016] 换教室
题目类型:期望\(DP\) 传送门:>Here< 题意:现有\(N\)个时间段,每个时间段上一节课.如果不申请换教室,那么时间段\(i\)必须去教室\(c[i]\)上课,如果申请换课成功, ...
- 用python 发 帝国cms 文章
在e\extent下面放一个jiekou.php #!/usr/bin/env python3 # -*- coding: utf-8 -*- import time import urlli ...
- [Qualcomm]A Detailed History of Qualcomm 高通的前世今生
https://www.semiwiki.com/forum/content/7353-detailed-history-qualcomm.html