• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ Server does not open tls/ssl problem

2057623

Member
Joined
Jan 16, 2012
Messages
130
Reaction score
15
Hey guys, I have a Baiak Thunger 1.3x server, I compiled the source code and everything is ok. When I try to open it, it won't open. This appears

> Loading configurations
> Establishing connection to the database...
MySQL Error Message: TLS/SSL error: SSL is required, but the server does not support it
ERROR: Failed to connect to database.

This is the first time I've been messing with otserv and I see something with SSL. I use Xampp 3.3.0 PHP 8.1. I installed the normal Myacc site. I went to open the server and it won't open. It looks like this. In config.lua, it's already configured correctly.

mysqlHost = "localhost"
mysqlUser = "root"
mysqlPass = ""
mysqlDatabase = "otserv"
mysqlPort = 3306
mysqlSock = ""
passwordType = "sha1"
sqlType = "mysql"

I have already tried changing the mysqlhost to 127.0.0.1 but without any success. If anyone can help me out, please let me know.
 
Disable SSL requirement in MySQL:
Open the my.cnf or my.ini file.
Add the following under the [mysqld] section:
LUA:
require_secure_transport = OFF
Save and restart MySQL.
Disable SSL in config.lua:
Code:
mysqlHost = "localhost"
mysqlUser = "root"
mysqlPass = ""
mysqlDatabase = "otserv"
mysqlPort = 3306
mysqlSock = ""
passwordType = "sha1"
sqlType = "mysql"
Add the line:
Code:
mysqlFlags = "CLIENT_SSL=0"
Restart the server and check the connection.

Test the connection directly from the terminal:
LUA:
mysql -u root -p --host=localhost --ssl-mode=DISABLED
If the connection succeeds, the issue is likely with the otserv configuration.

Let me know if it helped, I'm learning myself. We'll figure it out :D
 
Last edited:
Disable SSL requirement in MySQL:
Open the my.cnf or my.ini file.
Add the following under the [mysqld] section:
LUA:
require_secure_transport = OFF
Save and restart MySQL.
Disable SSL in config.lua:
Code:
mysqlHost = "localhost"
mysqlUser = "root"
mysqlPass = ""
mysqlDatabase = "otserv"
mysqlPort = 3306
mysqlSock = ""
passwordType = "sha1"
sqlType = "mysql"
Add the line:
Code:
mysqlFlags = "CLIENT_SSL=0"
Restart the server and check the connection.

Test the connection directly from the terminal:
LUA:
mysql -u root -p --host=localhost --ssl-mode=DISABLED
If the connection succeeds, the issue is likely with the otserv configuration.

Let me know if it helped, I'm learning myself. We'll figure it out :D
i having same problem, i tried to use this solution but dind't worked, ssl certificate already off but still having a mysql connection error.

1730231056846.webp
 

Attachments

  • 1730231100059.webp
    1730231100059.webp
    35.2 KB · Views: 23 · VirusTotal
Last edited:
Hey guys, I have a Baiak Thunger 1.3x server, I compiled the source code and everything is ok. When I try to open it, it won't open. This appears


MySQL Error Message: TLS/SSL error: SSL is required, but the server does not support it


This is the first time I've been messing with otserv and I see something with SSL. I use Xampp 3.3.0 PHP 8.1. I installed the normal Myacc site. I went to open the server and it won't open. It looks like this. In config.lua, it's already configured correctly.

mysqlHost = "localhost"
mysqlUser = "root"
mysqlPass = ""
mysqlDatabase = "otserv"
mysqlPort = 3306
mysqlSock = ""
passwordType = "sha1"
sqlType = "mysql"

I have already tried changing the mysqlhost to 127.0.0.1 but without any success. If anyone can help me out, please let me know.

Add more mysql_options for new version +3.5.x libmariadb from vcpkg.
It seems like they enabled it without specifying the ssl setting.
That's really annoying. security standards maybe.

In database.cpp, bool Database::connect()
after
C++:
mysql_options(handle, MYSQL_OPT_RECONNECT, &reconnect);
add
C++:
my_bool ssl_enforce = 0;
my_bool ssl_verify = 0;
unsigned int ssl_mode = 0;
mysql_options(handle, MYSQL_OPT_SSL_ENFORCE, &ssl_enforce);
mysql_options(handle, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, &ssl_verify);
mysql_options(handle, MYSQL_OPT_SSL_ENFORCE, &ssl_mode);
mysql_ssl_set(handle, nullptr, nullptr, nullptr, nullptr, nullptr);
 
Last edited:
Add more mysql_options for new version +3.5.x libmariadb from vcpkg.
It seems like they enabled it without specifying the ssl setting.
That's really annoying. security standards maybe.

In database.cpp, bool Database::connect()
after
C++:
mysql_options(handle, MYSQL_OPT_RECONNECT, &reconnect);
add
C++:
my_bool ssl_enforce = 0;
my_bool ssl_verify = 0;
unsigned int ssl_mode = 0;
mysql_options(handle, MYSQL_OPT_SSL_ENFORCE, &ssl_enforce);
mysql_options(handle, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, &ssl_verify);
mysql_options(handle, MYSQL_OPT_SSL_ENFORCE, &ssl_mode);
mysql_ssl_set(handle, nullptr, nullptr, nullptr, nullptr, nullptr);
TFS 1.6+ has the same problem on Linux Ubuntu, if you compile engine using vcpkg.
To fix it, above this line:
add:
C++:
    bool ssl_enforce = false;
    bool ssl_verify = false;
and above this if:
add:
C++:
    mysql_options(handle.get(), MYSQL_OPT_SSL_ENFORCE, &ssl_enforce);
    mysql_options(handle.get(), MYSQL_OPT_SSL_VERIFY_SERVER_CERT, &ssl_verify);
    mysql_ssl_set(handle.get(), nullptr, nullptr, nullptr, nullptr, nullptr);

EDIT:
I will test if it works fine on Windows and make PR.
 
Last edited:
Back
Top