@@ -19,10 +19,10 @@ import (
1919 "testing"
2020)
2121
22- // TestTLSConfigSecurity verifies that the TLS configuration meets security requirements
23- func TestTLSConfigSecurity ( t * testing. T ) {
24- // Create a TLS config similar to what's used in Start()
25- config := & tls.Config {
22+ // getTestTLSConfig returns the standard TLS configuration used in production
23+ // This should match the configuration in Start()
24+ func getTestTLSConfig () * tls. Config {
25+ return & tls.Config {
2626 MinVersion : tls .VersionTLS12 ,
2727 PreferServerCipherSuites : true ,
2828 CipherSuites : []uint16 {
@@ -39,6 +39,11 @@ func TestTLSConfigSecurity(t *testing.T) {
3939 tls .CurveP384 ,
4040 },
4141 }
42+ }
43+
44+ // TestTLSConfigSecurity verifies that the TLS configuration meets security requirements
45+ func TestTLSConfigSecurity (t * testing.T ) {
46+ config := getTestTLSConfig ()
4247
4348 // Test 1: Verify minimum TLS version is 1.2
4449 if config .MinVersion != tls .VersionTLS12 {
@@ -98,17 +103,7 @@ func TestTLSConfigSecurity(t *testing.T) {
98103
99104// TestWeakCipherSuitesNotPresent specifically tests that 3DES cipher suites are not present
100105func TestWeakCipherSuitesNotPresent (t * testing.T ) {
101- config := & tls.Config {
102- MinVersion : tls .VersionTLS12 ,
103- CipherSuites : []uint16 {
104- tls .TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 ,
105- tls .TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 ,
106- tls .TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 ,
107- tls .TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 ,
108- tls .TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305 ,
109- tls .TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 ,
110- },
111- }
106+ config := getTestTLSConfig ()
112107
113108 // These are the specific weak cipher suites mentioned in the issue
114109 forbiddenCiphers := map [uint16 ]string {
0 commit comments