Skip to content

fix(checkoutservice): Option 1 — Replace insecure gRPC with system CA TLS#2

Open
mikecstone wants to merge 1 commit into
masterfrom
fix/grpc-tls-system-ca
Open

fix(checkoutservice): Option 1 — Replace insecure gRPC with system CA TLS#2
mikecstone wants to merge 1 commit into
masterfrom
fix/grpc-tls-system-ca

Conversation

@mikecstone

Copy link
Copy Markdown
Owner

Summary

  • Replaces all 8 grpc.WithInsecure() calls with credentials.NewClientTLSFromCert(nil, ""), which uses the system root CA pool to validate server certificates
  • Fixes context.TODO()ctx in convertCurrency to restore proper timeout and cancellation propagation

Trade-offs

Pros:

  • Smallest diff — minimal code change, easy to review
  • No new infrastructure or cert management required beyond what your CA already issues
  • Works immediately if downstream services already present CA-signed certs

Cons:

  • One-way TLS only — the server is authenticated, but the client (this service) is not
  • Relies on the system CA pool, so it won't work with a private/internal CA unless that CA is installed on the host or container image

When to use this

Best fit if your services run behind a managed load balancer or service mesh that already handles cert issuance, and you need a fast, low-friction fix.

Test plan

  • Verify downstream services (shipping, cart, currency, payment, email, product catalog) present TLS certs signed by a CA in the system root pool
  • Confirm PlaceOrder end-to-end works after the change
  • Confirm that connection failures produce clear errors (not panics) when a service cert is invalid/expired

🤖 Generated with Claude Code

Replaces grpc.WithInsecure() on all 8 service connections with
credentials.NewClientTLSFromCert(nil, "") to enforce TLS using the
system root CA pool. Also fixes context.TODO() -> ctx in convertCurrency
to restore proper timeout and cancellation propagation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ox-security

ox-security Bot commented May 17, 2026

Copy link
Copy Markdown

OX Security Logo

OX Security reviewed this pull request — nothing to fix.

No issues found

Branch fix/grpc-tls-system-camaster

View scan in OX Security →

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.

1 participant