Skip to content

adds tls sni support to mysql2 #1405

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 1 commit into
base: master
Choose a base branch
from

Conversation

mikemackintosh
Copy link

This pull request introduces support for specifying a TLS SNI (Server Name Indication) name during MySQL client connections. This enhancement allows users to set a custom SNI hostname for TLS connections, improving flexibility and compatibility with certain server configurations.

Enhancements to TLS Configuration:

  • Updated the rb_mysql_connect function in ext/mysql2/client.c to accept an additional parameter, tls_sni_name, and use it to set the TLS SNI server name via the MYSQL_OPT_TLS_SNI_SERVERNAME option in the MySQL client library. [1] [2]
  • Modified the init_mysql2_client function in ext/mysql2/client.c to reflect the updated rb_mysql_connect method signature, increasing the number of expected arguments from 8 to 9.

Updates to Ruby Client Initialization:

  • Added support for the :tls_sni_name option in the initialize method of lib/mysql2/client.rb, allowing users to specify the SNI name when creating a MySQL client instance.
  • Ensured the tls_sni_name value is converted to a string if provided, and passed it as an argument to the updated connect method.

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