gpt4 book ai didi

ssl - MariaDB 上的 have_ssl 保持禁用状态,无法在 Debian 和 YaSSL 上启用 SSL

转载 作者:太空宇宙 更新时间:2023-11-03 13:20:50 27 4
gpt4 key购买 nike

我正在尝试在 Raspberry 3 上使用 TLS 设置 MariaDB,运行 dietpi安装了 LAMP。玛丽亚数据库 10.1.23

我关注了官方文档 mariadb.com还尝试了 linked guideline .

但是,当我查看我的变量时,have_ssl 保持禁用状态。

    MariaDB [(none)]> SHOW VARIABLES LIKE '%ssl%';
+---------------------+--------------------------------+
| Variable_name | Value |
+---------------------+--------------------------------+
| have_openssl | NO |
| have_ssl | DISABLED |
| ssl_ca | /etc/mysql/ssl/ca-cert.pem |
| ssl_capath | |
| ssl_cert | /etc/mysql/ssl/server-cert.pem |
| ssl_cipher | |
| ssl_crl | |
| ssl_crlpath | |
| ssl_key | /etc/mysql/ssl/server-key.pem |
| version_ssl_library | YaSSL 2.4.2 |
+---------------------+--------------------------------+
10 rows in set (0.01 sec)

这是我的/etc/mysql/mariadb.conf.d/50-server.cnf

#
ssl-ca=/etc/mysql/ssl/ca-cert.pem
ssl-cert=/etc/mysql/ssl/server-cert.pem
ssl-key=/etc/mysql/ssl/server-key.pem
#
# Accept only connections using the latest and most secure TLS protocol version.
# ..when MariaDB is compiled with OpenSSL:
# ssl-cipher=TLSv1.2
# ..when MariaDB is compiled with YaSSL (default in Debian):
ssl=on

尝试 openssl s_client 时,我得到以下结果:

openssl s_client -state -nbio -debug -connect 127.0.0.1:3306 | grep "ssl"
SSL_connect:before SSL initialization
SSL_connect:SSLv3/TLS write client hello
SSL_connect:error in SSLv3/TLS write client hello
1995634080:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../ssl/record/ssl3_record.c:252:

openssl s_client -connect 127.0.0.1:3306
CONNECTED(00000003)
1995855264:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../ssl/record/ssl3_record.c:252:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 5 bytes and written 176 bytes
Verification: OK
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.2
Cipher : 0000
Session-ID:
Session-ID-ctx:
Master-Key:
PSK identity: None
PSK identity hint: None
SRP username: None
Start Time: 1542233581
Timeout : 7200 (sec)
Verify return code: 0 (ok)
Extended master secret: no
---

我还尝试从另一个 Raspi 进行连接,结果如下:

root@DietPi:/etc/mysql/ssl# openssl s_client -state -nbio -debug -connect 192.168.1.89:3306 | grep "^ssl"
SSL_connect:before/connect initialization
SSL_connect:SSLv2/v3 write client hello A
SSL_connect:error in SSLv2/v3 read server hello A
SSL_connect:error in SSLv2/v3 read server hello A
548036626192:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:782:

到目前为止,我的研究并不是很成功。没有任何解决方案有效或适合我的环境。我也尝试安装 analyze-ssl.pl ,但是 cpan App::cpanminus 的安装失败了

Writing MYMETA.yml and MYMETA.json
MIYAGAWA/App-cpanminus-1.7044.tar.gz
/usr/bin/perl Makefile.PL INSTALLDIRS=site -- OK
Running make for M/MI/MIYAGAWA/App-cpanminus-1.7044.tar.gz
MIYAGAWA/App-cpanminus-1.7044.tar.gz
make -- NOT OK

明天我会尝试安装 analyze-ssl.pl 或打开另一个线程。只是想解释一下我的尝试。

如果有人能帮我解开我的谜语,我会很高兴。

谢谢!马库斯

最佳答案

您可以尝试将 openssl 默认生成的 PKCS#8 key 转换为 mariadb 的 PKCS#1 key

openssl rsa -in pcks#8.key -out pkcs#1.key 

在这个操作之后 mariadb 说

MariaDB [(none)]>  SHOW VARIABLES LIKE '%ssl%';
+---------------------+-----------------------------------------------+
| Variable_name | Value |
+---------------------+-----------------------------------------------+
| have_openssl | NO |
| have_ssl | YES |
| ssl_ca | /etc/mysql/ssl/mariaDB-CA.pem |
| ssl_capath | |
| ssl_cert | /etc/mysql/ssl/server.pem |
| ssl_cipher | |
| ssl_crl | |
| ssl_crlpath | |
| ssl_key | /etc/mysql/ssl/server.key |
| version_ssl_library | YaSSL 2.4.4 |
+---------------------+-----------------------------------------------+

大卫

关于ssl - MariaDB 上的 have_ssl 保持禁用状态,无法在 Debian 和 YaSSL 上启用 SSL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53309627/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com