Skip to content

Commit

Permalink
Merge "[FAB-4251] Only support TLS >= 1.2 to Kafka"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Yellick authored and Gerrit Code Review committed Jun 2, 2017
2 parents f68f939 + 2b8c0aa commit 3b40efa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion orderer/kafka/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func newBrokerConfig(kafkaVersion sarama.KafkaVersion, chosenStaticPartition int
brokerConfig.Net.TLS.Config = &tls.Config{
Certificates: []tls.Certificate{keyPair},
RootCAs: rootCAs,
MinVersion: 0, // TLS 1.0 (no SSL support)
MinVersion: tls.VersionTLS12,
MaxVersion: 0, // Latest supported TLS version
}
}
Expand Down
3 changes: 2 additions & 1 deletion orderer/kafka/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package kafka

import (
"crypto/tls"
"testing"

"github.com/Shopify/sarama"
Expand Down Expand Up @@ -132,7 +133,7 @@ func TestTLSConfigEnabled(t *testing.T) {
assert.Len(t, config.Net.TLS.Config.Certificates, 1)
assert.Len(t, config.Net.TLS.Config.RootCAs.Subjects(), 1)
assert.Equal(t, uint16(0), config.Net.TLS.Config.MaxVersion)
assert.Equal(t, uint16(0), config.Net.TLS.Config.MinVersion)
assert.Equal(t, uint16(tls.VersionTLS12), config.Net.TLS.Config.MinVersion)
}

func TestTLSConfigDisabled(t *testing.T) {
Expand Down

0 comments on commit 3b40efa

Please sign in to comment.