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

MySQL SSL connection error: unknown error number #3270

Closed
1 task done
Xenius97 opened this issue Dec 15, 2023 · 13 comments · Fixed by #3307
Closed
1 task done

MySQL SSL connection error: unknown error number #3270

Xenius97 opened this issue Dec 15, 2023 · 13 comments · Fixed by #3307
Labels
bug Something isn't working
Milestone

Comments

@Xenius97
Copy link
Contributor

Describe the bug

[2023-12-15 09:25:20] WARNING: [core]\ex_mysql\server\classes\mysql.lua:27: Bad usage @ 'dbConnect' [SSL connection error: unknown error number]

I think its caused by 6f1ccc8

Steps to reproduce

dbConnect()

Version

22331

Additional context

No response

Relevant log output

No response

Security Policy

  • I have read and understood the Security Policy and this issue is not security related.
@Xenius97 Xenius97 added the bug Something isn't working label Dec 15, 2023
@Xenius97
Copy link
Contributor Author

mysql log:

2023-12-15T08:23:52.857366Z 0 [System] [MY-010116] [Server] e:\wamp64\bin\mysql\mysql8.0.31\bin\mysqld.exe (mysqld 8.0.31) starting as process 11848
2023-12-15T08:23:52.914364Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-12-15T08:23:53.873515Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-12-15T08:23:54.591678Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2023-12-15T08:23:54.592137Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2023-12-15T08:23:54.621375Z 0 [System] [MY-010931] [Server] e:\wamp64\bin\mysql\mysql8.0.31\bin\mysqld.exe: ready for connections. Version: '8.0.31'  socket: ''  port: 3306  MySQL Community Server - GPL.
2023-12-15T21:12:51.100215Z 0 [System] [MY-013105] [Server] e:\wamp64\bin\mysql\mysql8.0.31\bin\mysqld.exe: Normal shutdown.

@Xenius97
Copy link
Contributor Author

Seems like disabling SSL solved

[mysqld]
ssl=off

@TracerDS
Copy link
Contributor

Seems like disabling SSL solved

[mysqld]
ssl=off

Disabling SSL might be a security issue in the near future. Its better to fix it from the origin instead of taking the easy way out

@Xenius97 Xenius97 reopened this Dec 18, 2023
@Xenius97
Copy link
Contributor Author

Okay, i think latest libmysql update broke mysql SSL, thats why didn't work.

@Xenius97 Xenius97 changed the title dbConnect not working MySQL SSL connection error: unknown error number Dec 18, 2023
@Lpsd
Copy link
Member

Lpsd commented Dec 18, 2023

I don't think SSL ever worked with our MySQL implementation, see #2772

@Xenius97
Copy link
Contributor Author

No errors with older server version

@Allerek
Copy link
Contributor

Allerek commented Dec 18, 2023

No errors with older server version

Quick guess that in older versions when you tried SSL but failed it just tried non-ssl connection. Now it might try to enforce SSL and not fall back to non-ssl on failure.

@theSarrum
Copy link
Contributor

I have an idea why this is happening. All this time, an old version of libmysql.dll (6.1.3.0) was shipped with the Windows server. After this change botder noticed it and updated the old files.

You might ask, what could have changed between 6.1.3.0 and the current version (6.1.11.0)? My guess is that the issue is that SSL was not used before, but with the new version it is now enabled by default.

Why is there a connection issue? The issue is that the MySQL connector supports only TLSv1 and TLSv1.1 protocols when compiled with yaSSL. Starting from MySQL 8.0.28, TLSv1 and TLSv1.1 are no longer supported.

If this is indeed the case, there are 2 possible solutions:

  1. Build libmysql with OpenSSL, which would enable TLSv1.2 support;
  2. Disable TLS encryption:
int ssl_mode = SSL_MODE_DISABLED;
mysql_options(m_handle, MYSQL_OPT_SSL_MODE, &ssl_mode);

If we choose the second option, it is probably better to add an option for dbConnect.

@TracerDS
Copy link
Contributor

We should go with the first one. Not having SSL is... A shame to say at least

@emmmhx
Copy link

emmmhx commented Dec 23, 2023

@Xenius97 What version of mysql server you are using now? I need a stable one for the server.

@Xenius97
Copy link
Contributor Author

Xenius97 commented Dec 23, 2023

@Xenius97 What version of mysql server you are using now? I need a stable one for the server.

8.2, latest WampServer (local)

@TheNormalnij
Copy link
Contributor

Some linux servers have related issue

ERROR: Could not load /game/mods/deathmatch/dbconmy.so - libssl.so.1.1: cannot open shared object file: No such file or directory
[23-12-28 21:34:49] WARNING: [System]/nelski/login_server.lua:4: Bad usage @ 'dbConnect' [Could not connect]

@TracerDS
Copy link
Contributor

TracerDS commented Mar 5, 2024

When the MySQL server enforces SSL, this will still happen again no matter if you enable SSL via options or not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants