Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TLSv1.2 can't be enabled in MySQL 5.7 #567

Closed
ralgozino opened this issue May 31, 2019 · 4 comments
Closed

TLSv1.2 can't be enabled in MySQL 5.7 #567

ralgozino opened this issue May 31, 2019 · 4 comments

Comments

@ralgozino
Copy link

ralgozino commented May 31, 2019

Hello!

I was trying to enable TLSv1.2 in a container based on the mysql:5.7 image, but I get a message saying that:

[Warning] Failed to set up SSL because of the following SSL library error: TLS version is invalid

I can reproduce this doing:
docker run --name sql57 -e MYSQL_ROOT_PASSWORD=example -d mysql:5.7 --ssl --tls-version "TLSv1.2"

The seems to be using OpenSSL, that according to MySQL documentation should be able to handle TLSv1.2.

mysql> show variables like '%ssl%';
+---------------+-----------------+
| Variable_name | Value           |
+---------------+-----------------+
| have_openssl  | YES             |
| have_ssl      | YES             |
| ssl_ca        | ca.pem          |
| ssl_capath    |                 |
| ssl_cert      | server-cert.pem |
| ssl_cipher    |                 |
| ssl_crl       |                 |
| ssl_crlpath   |                 |
| ssl_key       | server-key.pem  |
+---------------+-----------------+
9 rows in set (0.00 sec)

Maybe mysql is being compiled linked to an old version of openssl?

@ralgozino ralgozino changed the title TLSv1.2 can't be enabled in Mysql 5.7 TLSv1.2 can't be enabled in MySQL 5.7 May 31, 2019
@wglambert
Copy link

The openssl used is from Debian Stretch's stable repos https://packages.debian.org/stretch/openssl

$ docker run --rm mysql:5.7 openssl version
OpenSSL 1.1.0f  25 May 2017

@yosifkit
Copy link
Member

This seems to be a just limitation of the mysql:5.7 image and not in mysql:8.0; perhaps the upstream repo needs to be updated to compile with newer ssl support? (http://repo.mysql.com/apt/debian/).

$ docker run --name sql57 -e MYSQL_ROOT_PASSWORD=example -d mysql:5.7 --ssl
...
$ docker exec -it sql57 bash
root@d20308a71038:/# mysql -uroot -pexample 
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.26 MySQL Community Server (GPL)

Copyright (c) 2000, 2019, 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> SHOW GLOBAL VARIABLES LIKE 'tls_version';
+---------------+---------------+
| Variable_name | Value         |
+---------------+---------------+
| tls_version   | TLSv1,TLSv1.1 |
+---------------+---------------+
1 row in set (0.01 sec)

mysql>

$ docker run --name sql80 -e MYSQL_ROOT_PASSWORD=example -d mysql:8.0 --ssl
...
$ docker exec -it sql80 bash
root@da2c06eb3649:/# ps
bash: ps: command not found
root@da2c06eb3649:/# mysql -uroot -pexample
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.16 MySQL Community Server - GPL

Copyright (c) 2000, 2019, 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> SHOW GLOBAL VARIABLES LIKE 'tls_version';
+---------------+-----------------------+
| Variable_name | Value                 |
+---------------+-----------------------+
| tls_version   | TLSv1,TLSv1.1,TLSv1.2 |
+---------------+-----------------------+
1 row in set (0.01 sec)

@ltangvald
Copy link
Collaborator

This is a limitation in yaSSL (which is what the community edition of 5.7 uses currently); It only supports 1.1

@tianon
Copy link
Member

tianon commented Jun 3, 2019

Makes sense, thanks for confirming. ❤️ 👍

(Closing, given there's nothing else we can do here from the image.)

@tianon tianon closed this as completed Jun 3, 2019
Pontus4 added a commit to twingly/ecco that referenced this issue May 24, 2021
TLS 1.0 and 1.1 were disabled in the current latest version of JDK8,
but these are the only protocols supported by the MySQL 5.7 image.
SSL was disabled as a workaround to the problem.

JDK release notes:
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8202343

Comment about MySQL 5.7 protocol support:
docker-library/mysql#567 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants