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

Pass custom CA to grpc dial option #7395

Merged
merged 2 commits into from
Nov 19, 2024
Merged

Pass custom CA to grpc dial option #7395

merged 2 commits into from
Nov 19, 2024

Conversation

KrishnaIyer
Copy link
Member

Summary

Pass custom CA to grpc dial option, reverting: b2b5d2c

Changes

  • Pass custom CA to grpc dial option

Testing

Locally

Steps
  1. Set a custom CA to the CLI
export TTN_LW_CA=./ca.pem
  1. Test fetching a gateway.
Results

Before:

go run ./cmd/ttn-lw-cli gtw list
INFO	Telemetry is enabled. Check the documentation for more information on what is collected and how to disable it	{"documentation_url": "https://www.thethingsindustries.com/docs/reference/telemetry/cli"}
WARN	[core][Channel #1 SubChannel #2]grpc: addrConn.createTransport failed to connect to {Addr: "[::1]:8884", ServerName: "localhost:8884", }. Err: connection error: desc = "transport: authentication handshake failed: tls: failed to verify certificate: x509: “localhost” certificate is not trusted"
WARN	[core][Channel #1 SubChannel #2]grpc: addrConn.createTransport failed to connect to {Addr: "127.0.0.1:8884", ServerName: "localhost:8884", }. Err: connection error: desc = "transport: authentication handshake failed: tls: failed to verify certificate: x509: “localhost” certificate is not trusted"
WARN	Finished unary call	{"duration": 0.0924, "error": "error:unknown:unknown (connection error: desc = \"transport: authentication handshake failed: tls: failed to verify certificate: x509: “localhost” certificate is not trusted\")", "error_correlation_id": "f9413aaa5fbb43159868c2b607b0da4a", "grpc.method": "List", "grpc.service": "ttn.lorawan.v3.GatewayRegistry", "grpc_code": "Unavailable", "namespace": "grpc"}
error:unknown:unknown (connection error: desc = "transport: authentication handshake failed: tls: failed to verify certificate: x509: “localhost” certificate is not trusted")
    correlation_id=f9413aaa5fbb43159868c2b607b0da4a

After

go run ./cmd/ttn-lw-cli gtw list
INFO	Telemetry is enabled. Check the documentation for more information on what is collected and how to disable it	{"documentation_url": "https://www.thethingsindustries.com/docs/reference/telemetry/cli"}
[]
INFO	New patch version available	{"current": "3.32.1-dev", "docs_url": "https://www.thethingsindustries.com/docs/getting-started/upgrading/", "latest": "3.32.2"}
Regressions

This fixes a regression.

Notes for Reviewers

...

Checklist

  • Scope: The referenced issue is addressed, there are no unrelated changes.
  • Compatibility: The changes are backwards compatible with existing API, storage, configuration and CLI, according to the compatibility commitments in README.md for the chosen target branch.
  • Documentation: Relevant documentation is added or updated.
  • Testing: The steps/process to test this feature are clearly explained including testing for regressions.
  • Infrastructure: If infrastructural changes (e.g., new RPC, configuration) are needed, a separate issue is created in the infrastructural repositories.
  • Changelog: Significant features, behavior changes, deprecations and fixes are added to CHANGELOG.md.
  • Commits: Commit messages follow guidelines in CONTRIBUTING.md, there are no fixup commits left.

@KrishnaIyer KrishnaIyer added this to the v3.33.0 milestone Nov 19, 2024
@KrishnaIyer KrishnaIyer self-assigned this Nov 19, 2024
@KrishnaIyer KrishnaIyer requested a review from a team as a code owner November 19, 2024 16:10
@github-actions github-actions bot added the ui/cli This is related to ttn-lw-cli label Nov 19, 2024
@KrishnaIyer KrishnaIyer merged commit 9fb31df into v3.33 Nov 19, 2024
4 of 5 checks passed
@KrishnaIyer KrishnaIyer deleted the fix/cli-tls branch November 19, 2024 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ui/cli This is related to ttn-lw-cli
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants