Skip to content

Support ssl in mysql connections #2367

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Support ssl in mysql connections #2367

wants to merge 6 commits into from

Conversation

an-tao
Copy link
Member

@an-tao an-tao commented Aug 6, 2025

@an-tao an-tao requested a review from Copilot August 6, 2025 11:00
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds SSL support to MySQL connections by configuring SSL settings with null parameters. This enables SSL connections to be established while using default SSL settings.

  • Adds mysql_ssl_set() call with null parameters to enable basic SSL support
  • Maintains existing connection behavior while adding SSL capability

@@ -59,6 +59,12 @@ MysqlConnection::MysqlConnection(trantor::EventLoop *loop,
static MysqlEnv env;
static thread_local MysqlThreadEnv threadEnv;
mysql_init(mysqlPtr_.get());
Copy link
Preview

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.

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

Successfully merging this pull request may close these issues.

1 participant