Skip to content
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

Improve SSL support #716

Merged
merged 1 commit into from
Mar 6, 2019
Merged

Conversation

RafeKettler
Copy link

Related issue: #521

  • Add --ssl-cert and --ssl-key options to specify SSL public/private
    key files
  • Allow combining --ssl-allow-insecure with other --ssl* flags.
    mysql.RegisterTLSConfig allows combining the corresponding
    parameters in the tls.Config it receives, so gh-ost should
    allow this. I found being able to pass --ssl-allow-insecure along
    with --ssl-ca, --ssl-cert, and --ssl-key useful in testing.
  • Use the same TLS config everywhere. Since the CLI only supports
    a single set of --ssl* configuration parameters, this should be
    fine -- mysql.RegisterTLSConfig documentation indicates the
    TLS config given will not be modified, so it can safely be used
    in many goroutines provided we also do not modify it. The previous
    implementation did not work when the TLS config was duplicated,
    which happens when gh-ost walks up the replication chain trying
    to find the master. This is because, when the config is duplicated,
    we must call RegisterTLSConfig again with the new config. This
    config is exactly the same, so it's easiest to side-step the issue
    by registering the TLS config once and using it everywhere.

Related issue: github#521

 - Add --ssl-cert and --ssl-key options to specify SSL public/private
   key files
 - Allow combining --ssl-allow-insecure with other --ssl* flags.
   `mysql.RegisterTLSConfig` allows combining the corresponding
   parameters in the `tls.Config` it receives, so gh-ost should
   allow this. I found being able to pass --ssl-allow-insecure along
   with --ssl-ca, --ssl-cert, and --ssl-key useful in testing.
 - Use the same TLS config everywhere. Since the CLI only supports
   a single set of --ssl* configuration parameters, this should be
   fine -- `mysql.RegisterTLSConfig` documentation indicates the
   TLS config given will not be modified, so it can safely be used
   in many goroutines provided we also do not modify it. The previous
   implementation did not work when the TLS config was duplicated,
   which happens when gh-ost walks up the replication chain trying
   to find the master. This is because, when the config is duplicated,
   we must call `RegisterTLSConfig` again with the new config. This
   config is exactly the same, so it's easiest to side-step the issue
   by registering the TLS config once and using it everywhere.
@shlomi-noach shlomi-noach self-assigned this Feb 24, 2019
@shlomi-noach shlomi-noach self-requested a review February 24, 2019 05:58
@shlomi-noach shlomi-noach temporarily deployed to production/mysql_role=ghost_testing February 24, 2019 15:31 Inactive
@shlomi-noach
Copy link
Contributor

Thank you! I'll be testing in prod just to see that nothing breaks, though our tests will not cover the SSL functionality.

@shlomi-noach
Copy link
Contributor

This runs well in prod.

@shlomi-noach shlomi-noach merged commit 0e36857 into github:master Mar 6, 2019
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.

2 participants