MySQL ОШИБКА 2026 - ошибка SSL-соединения - Ubuntu 20.04 - PullRequest
5 голосов
/ 07 мая 2020

Недавно я обновил ОС своего локального компьютера с Ubuntu 18.04 до 20.04, я запускаю свой MySQL -сервер на CentOS (AWS). После обновления всякий раз, когда я пытаюсь подключиться к серверу MySQL, возникает ошибка подключения SSL.

$ 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 вместе с ним, я смогу подключиться удаленно.

$ 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> 

Запросы:

  1. Как подключиться, не передавая --ssl-mode=disabled
  2. Как передать этот --ssl-mode=disabled параметр в моем Django приложении, в настоящее время я определил его, как показано ниже, но я ' m по-прежнему получает ту же ошибку.
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'yamcha',
        'USER': 'yamcha',
        'PASSWORD': 'xxxxxxxxxxxxxxx',
        'HOST': 'database.yourproject.com',
        'PORT': '3309',
        'OPTIONS': {'ssl': False},
    }

1 Ответ

8 голосов
/ 21 мая 2020

В Ubuntu 20 улучшен уровень безопасности. Единственный способ, которым я мог подключиться, - это разрешение 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

...