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

api: fix the certificate problem in API client #2363

Merged
merged 2 commits into from
Apr 21, 2020

Conversation

nolouch
Copy link
Contributor

@nolouch nolouch commented Apr 20, 2020

Signed-off-by: nolouch nolouch@gmail.com

What problem does this PR solve?

Fix #2362

What is changed and how it works?

add TLS supports for the client.

Release note

  • Fix the certificate problem in API client

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Signed-off-by: nolouch <nolouch@gmail.com>
@nolouch nolouch added this to the v4.0.0-rc.2 milestone Apr 20, 2020
@nolouch nolouch added component/api HTTP API. type/bug The issue is confirmed as a bug. labels Apr 20, 2020
@nolouch nolouch requested review from rleungx and lhy1024 April 20, 2020 17:58
@nolouch
Copy link
Contributor Author

nolouch commented Apr 21, 2020

/rebuid

var (

// dialClient used to dial http request.
dialClient = cluster.DialClient
Copy link
Member

@rleungx rleungx Apr 21, 2020

Choose a reason for hiding this comment

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

The client in cluster package has a timeout. Does the client in API need it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I checked it and it only used in a redirect for the scheduler handler, I think it's ok to timeout.

Copy link
Member

Choose a reason for hiding this comment

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

If we use API to get all regions and the region number is large, will it break the process of getting regions?

Copy link
Contributor Author

@nolouch nolouch Apr 21, 2020

Choose a reason for hiding this comment

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

the client in the user, not in PD. and if request to the follower, the redirected client is in the pkg/apiutil/serverapi, that's already supports TLS.

Copy link
Member

Choose a reason for hiding this comment

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

got

@nolouch
Copy link
Contributor Author

nolouch commented Apr 21, 2020

/rebuild

1 similar comment
@nolouch
Copy link
Contributor Author

nolouch commented Apr 21, 2020

/rebuild

@lhy1024
Copy link
Contributor

lhy1024 commented Apr 21, 2020

/merge

@sre-bot sre-bot added the status/can-merge Indicates a PR has been approved by a committer. label Apr 21, 2020
@lhy1024
Copy link
Contributor

lhy1024 commented Apr 21, 2020

/merge

1 similar comment
@lhy1024
Copy link
Contributor

lhy1024 commented Apr 21, 2020

/merge

@sre-bot
Copy link
Contributor

sre-bot commented Apr 21, 2020

/run-all-tests

@sre-bot sre-bot merged commit 4dae8a3 into tikv:master Apr 21, 2020
@nolouch nolouch deleted the fix-redirect branch April 21, 2020 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/api HTTP API. status/can-merge Indicates a PR has been approved by a committer. type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't begin evict leader when TLS between components is enabled
4 participants