Skip to content

Commit

Permalink
[FAB-4251] Only support TLS >= 1.2 to Kafka
Browse files Browse the repository at this point in the history
Change-Id: Ib9fd3573e12e5f5916e58d7e96792c95af496ceb
Signed-off-by: Luis Sanchez <sanchezl@us.ibm.com>
  • Loading branch information
Luis Sanchez committed Jun 1, 2017
1 parent a01b2f9 commit 2b8c0aa
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 2b8c0aa

Please sign in to comment.