Skip to content

Verify server TLS certificates by default when dialing gRIBI targets. - #291

Merged
alshabib merged 3 commits into
mainfrom
skip-tls-auth
Nov 20, 2026
Merged

alshabib merged 3 commits into
mainfrom
skip-tls-auth

Conversation

@robshakir

Copy link
Copy Markdown
Member

TLDR

Verify server TLS certificates against the host root CA pool by default across
client.Dial, fluent, and reconciler.NewRemoteRIB, and accept standard
grpc.DialOption values for custom credentials.

Problem Statement

(*Client).Dial previously hardcoded tls.Config{InsecureSkipVerify: true}
and accepted an unimplemented DialOpt marker interface. Every dial through
client.Dial, fluent.WithTarget, or reconciler.NewRemoteRIB skipped
verifying server certificates. In addition, cmd/ccli omitted transport
credentials when both -insecure and -skip_verify were false.

Proposed Solution

  • client.Dial: Remove DialOpt, accept ...grpc.DialOption, and prepend
    credentials.NewTLS(&tls.Config{}) so callers can override transport
    credentials via grpc.WithTransportCredentials.
  • fluent and reconciler: Add WithDialOptions(...grpc.DialOption) on
    the fluent connection builder and forward ...grpc.DialOption in
    reconciler.NewRemoteRIB.
  • CLI and Demo Flags: Default -skip_verify to false in cmd/ccli and
    demo/ipv4, and configure verified TLS in cmd/ccli by default.

Implementation Details

  • client/gribiclient(_test)?.go: Replace DialOpt with grpc.DialOption
    and add TestDialTLS covering untrusted CAs, mismatched IP SANs, custom root
    pools, plaintext servers, and per-RPC metadata.
  • fluent/fluent(_test)?.go and rib/reconciler/*: Thread dial options
    into Dial and test default untrusted-certificate rejection and custom root
    CA pools.
  • {compliance,device}/*_test.go, cmd/ccli, and demo/ipv4: Pass
    explicit skip-verify credentials for self-signed test fixtures and update CLI
    flag defaults.

 * (M) client/gribiclient(_test)?.go
   - replace unimplemented DialOpt with grpc.DialOption and verify server
     TLS certificates against the host root CA pool by default.
 * (M) fluent/fluent(_test)?.go
   - add WithDialOptions to pass gRPC dial options when dialing a target.
 * (M) rib/reconciler/{remote,remote_test,reconcile_test}.go
   - accept variadic grpc.DialOption arguments in NewRemoteRIB.
 * (M) {compliance/compliance,device/device}_test.go
   - pass skip-verify credentials for self-signed test fixtures.
 * (M) cmd/ccli/ccli_test.go
 * (M) demo/ipv4/ipv4_test.go
   - default -skip_verify to false and configure verified TLS by default.
@robshakir
robshakir requested a review from alshabib November 19, 2026 04:03
@robshakir

Copy link
Copy Markdown
Member Author

@thesrinath -- please could you review this PR as well? (GitHub would not allow adding you directly as a repository reviewer.)

@alshabib
alshabib merged commit 80efa84 into main Nov 20, 2026
15 checks passed
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