Skip to content

Commit 448917b

Browse files
author
Jason Yellick
committed
[FAB-8246] Make orderer mutual TLS conf consistent
The peer turns on mutual TLS with clientAuthRequired, while the orderer turns on mutual TLS with ClientAuthEnabled. This is inconsistent, and as it's a v1.1 feature, may be safely fixed without worry for backwards compatability. Change-Id: Ic3c2817177df0dae6e76bc3d6c8cd965d0502d40 Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
1 parent 8e98cdc commit 448917b

File tree

5 files changed

+29
-29
lines changed

5 files changed

+29
-29
lines changed

examples/cluster/config/orderer.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ General:
3434
Certificate: tls/server.crt
3535
RootCAs:
3636
- tls/ca.crt
37-
ClientAuthEnabled: false
37+
ClientAuthRequired: false
3838
ClientRootCAs:
3939

4040
# Log Level: The level at which to log. This accepts logging specifications

orderer/common/localconfig/config.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ type Keepalive struct {
9797

9898
// TLS contains configuration for TLS connections.
9999
type TLS struct {
100-
Enabled bool
101-
PrivateKey string
102-
Certificate string
103-
RootCAs []string
104-
ClientAuthEnabled bool
105-
ClientRootCAs []string
100+
Enabled bool
101+
PrivateKey string
102+
Certificate string
103+
RootCAs []string
104+
ClientAuthRequired bool
105+
ClientRootCAs []string
106106
}
107107

108108
// Authentication contains configuration parameters related to authenticating

orderer/common/server/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func initializeServerConfig(conf *config.TopLevel) comm.ServerConfig {
136136
// secure server config
137137
secureOpts := &comm.SecureOptions{
138138
UseTLS: conf.General.TLS.Enabled,
139-
RequireClientCert: conf.General.TLS.ClientAuthEnabled,
139+
RequireClientCert: conf.General.TLS.ClientAuthRequired,
140140
}
141141
// check to see if TLS is enabled
142142
if secureOpts.UseTLS {

orderer/common/server/main_test.go

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ func TestInitializeServerConfig(t *testing.T) {
7979
conf := &config.TopLevel{
8080
General: config.General{
8181
TLS: config.TLS{
82-
Enabled: true,
83-
ClientAuthEnabled: true,
84-
Certificate: "main.go",
85-
PrivateKey: "main.go",
86-
RootCAs: []string{"main.go"},
87-
ClientRootCAs: []string{"main.go"},
82+
Enabled: true,
83+
ClientAuthRequired: true,
84+
Certificate: "main.go",
85+
PrivateKey: "main.go",
86+
RootCAs: []string{"main.go"},
87+
ClientRootCAs: []string{"main.go"},
8888
},
8989
},
9090
}
@@ -131,12 +131,12 @@ func TestInitializeServerConfig(t *testing.T) {
131131
&config.TopLevel{
132132
General: config.General{
133133
TLS: config.TLS{
134-
Enabled: true,
135-
ClientAuthEnabled: true,
136-
Certificate: tc.certificate,
137-
PrivateKey: tc.privateKey,
138-
RootCAs: []string{tc.rootCA},
139-
ClientRootCAs: []string{tc.clientCertificate},
134+
Enabled: true,
135+
ClientAuthRequired: true,
136+
Certificate: tc.certificate,
137+
PrivateKey: tc.privateKey,
138+
RootCAs: []string{tc.rootCA},
139+
ClientRootCAs: []string{tc.clientCertificate},
140140
},
141141
},
142142
})
@@ -255,8 +255,8 @@ func TestInitializeGrpcServer(t *testing.T) {
255255
ListenAddress: host,
256256
ListenPort: uint16(port),
257257
TLS: config.TLS{
258-
Enabled: false,
259-
ClientAuthEnabled: false,
258+
Enabled: false,
259+
ClientAuthRequired: false,
260260
},
261261
},
262262
}
@@ -280,8 +280,8 @@ func TestUpdateTrustedRoots(t *testing.T) {
280280
ListenAddress: "localhost",
281281
ListenPort: uint16(port),
282282
TLS: config.TLS{
283-
Enabled: false,
284-
ClientAuthEnabled: false,
283+
Enabled: false,
284+
ClientAuthRequired: false,
285285
},
286286
},
287287
}
@@ -309,10 +309,10 @@ func TestUpdateTrustedRoots(t *testing.T) {
309309
ListenAddress: "localhost",
310310
ListenPort: uint16(port),
311311
TLS: config.TLS{
312-
Enabled: true,
313-
ClientAuthEnabled: true,
314-
PrivateKey: filepath.Join(".", "testdata", "tls", "server.key"),
315-
Certificate: filepath.Join(".", "testdata", "tls", "server.crt"),
312+
Enabled: true,
313+
ClientAuthRequired: true,
314+
PrivateKey: filepath.Join(".", "testdata", "tls", "server.key"),
315+
Certificate: filepath.Join(".", "testdata", "tls", "server.crt"),
316316
},
317317
},
318318
}

sampleconfig/orderer.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ General:
3434
Certificate: tls/server.crt
3535
RootCAs:
3636
- tls/ca.crt
37-
ClientAuthEnabled: false
37+
ClientAuthRequired: false
3838
ClientRootCAs:
3939

4040
# Keepalive settings for the GRPC server.

0 commit comments

Comments
 (0)