Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Allow configurable Mint adapter #370

Merged
merged 7 commits into from
Jun 27, 2024

Conversation

caike
Copy link
Contributor

@caike caike commented Jun 24, 2024

Problem

The use case for this came from attempting to connect to a particular gRPC server which was rejecting the connection due to the default transport_options being used:

[
    timeout: :infinity,
    verify: :verify_peer,
    depth: 99,
    cacert_file: "...." # redacted
  ]

Solution

After overriding transport_options I was able to connect to said server. I believe the ability to override these options could also be useful for others. This PR allows the adapter options to be set from the client application via:

config :grpc, GRPC.Client.Adapters.Mint, transport_opts: []

@sleipnir
Copy link
Collaborator

sleipnir commented Jun 24, 2024

Hi @caike! First of all, thank you for taking the time for us.
If I'm not wrong we deprecated options via configuration in the past in favor of passing configurations as options directly at GRPC.Server.Supervisor initialization.

Am I right on this @polvalente ?

@caike
Copy link
Contributor Author

caike commented Jun 26, 2024

Hi @caike! First of all, thank you for taking the time for us. If I'm not wrong we deprecated options via configuration in the past in favor of passing configurations as options directly at GRPC.Server.Supervisor initialization.

Am I right on this @polvalente ?

Thanks for the feedback and for maintaining this project!

How about when the application is simply a client to an external grpc server ? I have a client Stub that connects to an external server and I'm not using GRPC.Server.Supervisor at all. For more context, this my current use case

@sleipnir
Copy link
Collaborator

@caike Thank you very much!

Sorry for my inattention, you are correct and your PR already covers what is necessary. I will review it.

Copy link
Collaborator

@sleipnir sleipnir left a comment

Choose a reason for hiding this comment

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

Just a small comment

lib/grpc/client/adapters/mint.ex Outdated Show resolved Hide resolved
@caike caike requested a review from sleipnir June 26, 2024 13:41
@sleipnir sleipnir merged commit 6bbc6c7 into elixir-grpc:master Jun 27, 2024
8 checks passed
@sleipnir
Copy link
Collaborator

thank you for this work @caike

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants