-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
Add Intermediate CA certs to dial options #3225
Conversation
internal/pkg/gateway/registry.go
Outdated
@@ -353,7 +353,7 @@ func (reg *registry) connectChannelPeers(channel string, force bool) error { | |||
for mspid, infoset := range reg.discovery.IdentityInfo().ByOrg() { | |||
var tlsRootCerts [][]byte | |||
if mspInfo, ok := config.GetMsps()[mspid]; ok { | |||
tlsRootCerts = mspInfo.GetTlsRootCerts() | |||
tlsRootCerts = append(mspInfo.GetTlsRootCerts(), mspInfo.GetTlsIntermediateCerts()...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
concatenating slices in this way may alter the root cert slice.
Let's do it in the right way by having the left most slice a nil slice.
@@ -121,6 +121,8 @@ func TestStaleMultiChannelOrdererConnections(t *testing.T) { | |||
func buildConfig(t *testing.T, orderers []string) *dp.ConfigResult { | |||
ca, err := tlsgen.NewCA() | |||
require.NoError(t, err) | |||
ica, err := ca.NewIntermediateCA() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't test the change in line 424
The gateway was omitting to include TLS intermediate certificates in the dial options when connecting to other nodes. This commit appends them to the splice of root certs in the endpoint config. Signed-off-by: andrew-coleman <andrew_coleman@uk.ibm.com>
74d1309
to
b17fd03
Compare
@Mergifyio backport release-2.4 |
✅ Backports have been created
|
The gateway was omitting to include TLS intermediate certificates in the dial options when connecting to other nodes. This commit appends them to the splice of root certs in the endpoint config. Signed-off-by: andrew-coleman <andrew_coleman@uk.ibm.com> (cherry picked from commit 7b7b6e9)
The gateway was omitting to include TLS intermediate certificates in the dial options when connecting to other nodes. This commit appends them to the splice of root certs in the endpoint config. Signed-off-by: andrew-coleman <andrew_coleman@uk.ibm.com> (cherry picked from commit 7b7b6e9) Co-authored-by: Andrew Coleman <andrew_coleman@uk.ibm.com>
The gateway was omitting to include TLS intermediate certificates in the dial options when connecting to other nodes.
This commit appends them to the splice of root certs in the endpoint config.
Resolves #3224
Signed-off-by: andrew-coleman andrew_coleman@uk.ibm.com