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

credentials: Add experimental credentials that don't enforce ALPN #7980

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

arjan-bal
Copy link
Contributor

Fixes: #7922
Related Issue: #434

This change copies the existing TLS credentials, removing the code for ALPN enforcement. These credentials will be removed in a couple of releases and users who still need to disable ALPN can copy the credentials as is. Changes made:

  • Copy credentials/tls.go to experimental/credentials/tls.go. Add suffix WithALPNDisabled to constructors.
  • Copy required packages from internal/credentials to experimental/credentials/internal.
  • Improve error message when connection fails due to ALPN.

RELEASE NOTES:

  • experimental/credentials: Experimental transport credentials are added which don't enforce ALPN. These are intended for migration purposes and will be removed in upcoming grpc-go releases. Subsequently, users can copy these credentials and user them if needed.

@arjan-bal arjan-bal added the Type: Internal Cleanup Refactors, etc label Jan 6, 2025
@arjan-bal arjan-bal added this to the 1.70 Release milestone Jan 6, 2025
@arjan-bal arjan-bal requested a review from dfawley January 6, 2025 07:45
Copy link

codecov bot commented Jan 6, 2025

Codecov Report

Attention: Patch coverage is 80.64516% with 30 lines in your changes missing coverage. Please review.

Project coverage is 82.10%. Comparing base (724f450) to head (78c4cbf).

Files with missing lines Patch % Lines
experimental/credentials/tls.go 73.45% 26 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7980      +/-   ##
==========================================
+ Coverage   82.05%   82.10%   +0.05%     
==========================================
  Files         381      384       +3     
  Lines       38539    38692     +153     
==========================================
+ Hits        31622    31768     +146     
- Misses       5602     5605       +3     
- Partials     1315     1319       +4     
Files with missing lines Coverage Δ
credentials/tls.go 86.57% <100.00%> (ø)
experimental/credentials/internal/spiffe.go 100.00% <100.00%> (ø)
experimental/credentials/internal/syscallconn.go 100.00% <100.00%> (ø)
experimental/credentials/tls.go 73.45% <73.45%> (ø)

... and 28 files with indirect coverage changes

@@ -32,6 +32,8 @@ import (
"google.golang.org/grpc/internal/envconfig"
)

const alpnFailureHelpMessage = "If you upgraded from a grpc-go version earlier than 1.67, your TLS connections may stopped working due to ALPN enforcement. For more details, see: https://github.com/grpc/grpc-go/issues/434. To disable ALPN enforcement, set the environment variable GRPC_ENFORCE_ALPN_ENABLED to false, or use the experimental credentials available under experimental/credentials. Note that these workarounds are intended for migration purposes and will be removed in future grpc-go versions."
Copy link
Member

Choose a reason for hiding this comment

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

Nit: "may have stopped working"

Also I think I'd remove everything after "see 434". The rest of the explanation can be in there.

@@ -0,0 +1,252 @@
/*
*
* Copyright 2016 gRPC authors.
Copy link
Member

Choose a reason for hiding this comment

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

Update please

*
*/

// Package credentials contains experimental TLS credentials.
Copy link
Member

Choose a reason for hiding this comment

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

This should have a big scary comment about how these credentials should only be used to maintain compatibility for people relying upon interoperability with clients violating the HTTP/2 specification, and that it will be deleted, so users should not use it directly. Instead they either need to vendor gRPC or copy these credentials.

@@ -0,0 +1,393 @@
/*
*
* Copyright 2023 gRPC authors.
Copy link
Member

Choose a reason for hiding this comment

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

Date

@dfawley dfawley assigned arjan-bal and unassigned dfawley Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Updating from go-grpc v1.64.0 to v1.68.1 broke our AWS deployments, migration path is unclear
2 participants