Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions orm_lib/src/mysql_impl/MysqlConnection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ MysqlConnection::MysqlConnection(trantor::EventLoop *loop,
static MysqlEnv env;
static thread_local MysqlThreadEnv threadEnv;
mysql_init(mysqlPtr_.get());
Copy link

Copilot AI Aug 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mysql_ssl_set() call lacks documentation explaining its purpose and the implications of using null parameters. Consider adding a comment explaining that this enables SSL with default settings and that certificate verification is not performed.

Suggested change
mysql_init(mysqlPtr_.get());
mysql_init(mysqlPtr_.get());
// Enable SSL with default settings. All parameters are set to nullptr,
// which means SSL is enabled but certificate verification is NOT performed.
// This may have security implications; see MySQL C API documentation for details.

Copilot uses AI. Check for mistakes.
mysql_ssl_set(mysqlPtr_.get(),
nullptr, // key
nullptr, // cert
nullptr, // CA
nullptr, // CApath
nullptr); // cipher
Comment thread
an-tao marked this conversation as resolved.
Outdated
mysql_options(mysqlPtr_.get(), MYSQL_OPT_NONBLOCK, nullptr);
#ifdef HAS_MYSQL_OPTIONSV
mysql_optionsv(mysqlPtr_.get(), MYSQL_OPT_RECONNECT, &reconnect_);
Expand Down
Loading