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

client support tls connections #40

Merged
merged 1 commit into from
Jul 26, 2024

Conversation

famarting
Copy link
Contributor

This PR adds support for tls connections. The change is made in a non breaking manner by adding the parameter as an optional and at the end of the constructors, so existing client instantiations will continue compiling without problems.

The idea for this change is to use it in the Dapr js SDK for workflows... currently the normal Dapr js sdk supports TLS connections but the workflows SDK (based on durabletask) does not support TLS https://github.com/dapr/js-sdk/blob/main/src/workflow/client/DaprWorkflowClient.ts#L48

@cgillum cgillum requested a review from kaibocai July 12, 2024 14:55
@cgillum
Copy link
Member

cgillum commented Jul 12, 2024

The change looks fine to me. Alternatively, could we enable TLS whenever we see that the address is HTTPS (and not HTTP), and not introduce the flag?

@famarting
Copy link
Contributor Author

famarting commented Jul 12, 2024

The change looks fine to me. Alternatively, could we enable TLS whenever we see that the address is HTTPS (and not HTTP), and not introduce the flag?

I agree, that solution would also be fine. However it would require parsing logic similar to this https://github.com/dapr/go-sdk/blob/main/client/internal/parse.go#L31 in order to support the many ways in which tls can be specified in grpc. What I did in this PR is much simpler

@cgillum
Copy link
Member

cgillum commented Jul 12, 2024

It just occurred to me that the endpoint configuration doesn't include the scheme (like http or https), so you can't really use that for a TLS hint. I'm okay with this as a simple enough solution.

@cgillum
Copy link
Member

cgillum commented Jul 12, 2024

Looks like the test and build pipeline is failing. @kaibocai, is this something you're able to take a look at?

@kaibocai
Copy link
Member

Hi @famarting, thanks for your contribution. Can you try rebasing your PR against the main branch? We had a fix on the CI let's see if that makes the CI green for your PR. Thanks.

@famarting
Copy link
Contributor Author

updated

@TonyPythoneer
Copy link
Contributor

Hi @cgillum,

I fixed that in #42 when there was a timeout issue in the test.
I believe this PR can pass the tests after my PR merges.


Hi @famarting,

Amazing! It's passed now! 🥳


Hi @kaibocai,

I think this PR can move forward as it gets updated. 😊

@kaibocai kaibocai merged commit 822fd5c into microsoft:main Jul 26, 2024
2 checks passed
@famarting
Copy link
Contributor Author

Hi all! Thank you for merging the PR, my intention was to use this change in the Dapr js sdk to implement a new feature.

Could any of you please create a new release of this library so I can use it from the Dapr js sdk?

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.

4 participants