MySQL错误2026-SSL连接错误-Ubuntu 20.04 [英] MySQL ERROR 2026 - SSL connection error - Ubuntu 20.04
问题描述
我最近将本地计算机操作系统从Ubuntu 18.04升级到20.04,我在CentOS(AWS)上运行MySQL服务器.每当我尝试连接到MySQL服务器时,升级后都会引发SSL连接错误.
I've recently upgraded my local machine OS from Ubuntu 18.04 to 20.04, I'm running my MySQL-server on CentOS (AWS). Post upgrade whenever I'm trying to connect to MySQL server it is throwing SSL connection error.
$ mysql -u yamcha -h database.yourproject.com -p --port 3309
ERROR 2026 (HY000): SSL connection error: error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol
但是,如果我同时传递-ssl-mode = disabled
选项,则可以远程连接.
But if I pass --ssl-mode=disabled
option along with it, I'm able to connect remotely.
$ mysql -u yamcha -h database.yourproject.com -p --port 3309 --ssl-mode=disabled
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 22158946
Server version: 5.7.26 MySQL Community Server (GPL)
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
查询:
- 如何在不通过
-ssl-mode = disabled
的情况下进行连接 - 如何在Django应用程序中传递此
-ssl-mode = disabled
选项,目前,我已按如下所示对其进行了定义,但仍然遇到相同的错误.
- How to connect without passing
--ssl-mode=disabled
- How to pass this
--ssl-mode=disabled
option in my Django application, currently I've defined it as shown below, but I'm still getting the same error.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'yamcha',
'USER': 'yamcha',
'PASSWORD': 'xxxxxxxxxxxxxxx',
'HOST': 'database.yourproject.com',
'PORT': '3309',
'OPTIONS': {'ssl': False},
}
推荐答案
Ubuntu 20已提高了安全级别.我可以连接允许tls 1的唯一方法.
Ubuntu 20 has improved the security level. The only way i could connect whas allowing the tls 1 .
编辑此文件:
/usr/lib/ssl/openssl.cnf
并放在文件的开头:
openssl_conf = default_conf
在该文件的末尾:
[ default_conf ]
ssl_conf = ssl_sect
[ssl_sect]
system_default = ssl_default_sect
[ssl_default_sect]
MinProtocol = TLSv1
CipherString = DEFAULT:@SECLEVEL=1
它对我有很大帮助: https://askubuntu.com/questions/1233186/ubuntu-20-04-how-to-set-lower-ssl-security-level
这篇关于MySQL错误2026-SSL连接错误-Ubuntu 20.04的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!