adds tls sni support to mysql2 #1405
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
rb_mysql_connect
function inext/mysql2/client.c
to accept an additional parameter,tls_sni_name
, and use it to set the TLS SNI server name via theMYSQL_OPT_TLS_SNI_SERVERNAME
option in the MySQL client library. [1] [2]init_mysql2_client
function inext/mysql2/client.c
to reflect the updatedrb_mysql_connect
method signature, increasing the number of expected arguments from 8 to 9.Updates to Ruby Client Initialization:
:tls_sni_name
option in theinitialize
method oflib/mysql2/client.rb
, allowing users to specify the SNI name when creating a MySQL client instance.tls_sni_name
value is converted to a string if provided, and passed it as an argument to the updatedconnect
method.