connect --ssl-mode:REQURED< : MYSQL_OPT_SSL_MODE
Posted by: Jorge Luis Borlando
Date: May 02, 2026 08:57AM

Hello everyone, my name is Jorge. I work with the Xbase++ language and use the MySQL libmysql.dll library version 8.0.44.
The issue I’m having is that I can’t correctly set the options to connect to a database with SSL enabled.
From the command line it works perfectly with:
mysql -h <ip> -P 3306 -u <user> -p --ssl-mode=REQUIRED
However, in my application I execute the following steps and I can’t get it to connect:

MYSQL_OPT_SSL_MODE I searched for it on Google because in xbase I don't have the possibility of accessing the structures of mysql.h and mysql_com.h
#define MYSQL_OPT_SSL_MODE 129

nFlag := 0
cSocket := ''
nPort := 3306
pMySql := mysql_init()

nMode := U2Bin( 2 ) // "REQUIRED"
mysql_options( pMySql, MYSQL_OPT_SSL_MODE, @nMode )

mysql_real_connect( @pMysql, @cServer, @cUser, @cPassword, NIL, @nPort, @cSocket, @nFlag )


I also tried setting the call to mysql_ssl_set( @pMySql ) before mysql_real_connect(), and combining it with the parameter nFlag := CLIENT_SSL (value 2048), but without success.
Could you help me understand what the correct steps are to configure SSL in this scenario and get the connection to work the same way as from the mysql.exe client with --ssl-mode=REQUIRED?
Thank you very much for your time and any guidance you can provide!

Options: ReplyQuote


Subject
Views
Written By
Posted
connect --ssl-mode:REQURED< : MYSQL_OPT_SSL_MODE
37
May 02, 2026 08:57AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.