Skip to content

Commit

Permalink
[FAB-9605] Export list of default cipher suites
Browse files Browse the repository at this point in the history
Change-Id: Ie4f1c745bddc1126fbc47c517b8b465e2c3f171e
Signed-off-by: Kostas Christidis <[email protected]>
  • Loading branch information
kchristidis committed Apr 20, 2018
1 parent 21d15a6 commit 0134850
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions core/comm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"google.golang.org/grpc/keepalive"
)

// Configuration defaults
var (
// Max send and receive bytes for grpc clients and servers
MaxRecvMsgSize = 100 * 1024 * 1024
Expand All @@ -27,7 +28,7 @@ var (
ServerMinInterval: time.Duration(1) * time.Minute, // match ClientInterval
}
// strong TLS cipher suites
tlsCipherSuites = []uint16{
DefaultTLSCipherSuites = []uint16{
tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
Expand Down Expand Up @@ -62,7 +63,7 @@ type ClientConfig struct {
}

// SecureOptions defines the security parameters (e.g. TLS) for a
// GRPCServer instance
// GRPCServer or GRPCClient instance
type SecureOptions struct {
// PEM-encoded X509 public key to be used for TLS communication
Certificate []byte
Expand All @@ -82,7 +83,7 @@ type SecureOptions struct {
CipherSuites []uint16
}

// KeepAliveOptions is used to set the gRPC keepalive settings for both
// KeepaliveOptions is used to set the gRPC keepalive settings for both
// clients and servers
type KeepaliveOptions struct {
// ClientInterval is the duration after which if the client does not see
Expand Down
2 changes: 1 addition & 1 deletion core/comm/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func NewGRPCServerFromListener(listener net.Listener, serverConfig ServerConfig)

//set up our TLS config
if len(secureConfig.CipherSuites) == 0 {
secureConfig.CipherSuites = tlsCipherSuites
secureConfig.CipherSuites = DefaultTLSCipherSuites
}
getCert := func(_ *tls.ClientHelloInfo) (*tls.Certificate, error) {
cert := grpcServer.serverCertificate.Load().(tls.Certificate)
Expand Down

0 comments on commit 0134850

Please sign in to comment.