0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-23 22:27:38 -05:00

change tls ssl3 protocol key and tests

This commit is contained in:
Guilherme Rezende 2015-05-18 18:15:41 -03:00
parent 823a7eac03
commit a94c7dd788
2 changed files with 6 additions and 6 deletions

View file

@ -12,7 +12,7 @@ import (
// Map of supported protocols // Map of supported protocols
// SSLv3 will be not supported in next release // SSLv3 will be not supported in next release
var supportedProtocols = map[string]uint16{ var supportedProtocols = map[string]uint16{
"ssl3": tls.VersionSSL30, "ssl3.0": tls.VersionSSL30,
"tls1.0": tls.VersionTLS10, "tls1.0": tls.VersionTLS10,
"tls1.1": tls.VersionTLS11, "tls1.1": tls.VersionTLS11,
"tls1.2": tls.VersionTLS12, "tls1.2": tls.VersionTLS12,

View file

@ -18,11 +18,11 @@ func TestTLSParseNoOptional(t *testing.T) {
} }
if c.TLS.ProtocolMinVersion != tls.VersionTLS11 { if c.TLS.ProtocolMinVersion != tls.VersionTLS11 {
t.Errorf("Expected 'tls1.1' ProtocolMinVersion , got %v", c.TLS.ProtocolMinVersion) t.Errorf("Expected 'tls1.1 (0x0302)' as ProtocolMinVersion, got %#v", c.TLS.ProtocolMinVersion)
} }
if c.TLS.ProtocolMaxVersion != tls.VersionTLS12 { if c.TLS.ProtocolMaxVersion != tls.VersionTLS12 {
t.Errorf("Expected ProtocolMaxVersion 0, got %v", c.TLS.ProtocolMaxVersion) t.Errorf("Expected 'tls1.2 (0x0303)' as ProtocolMaxVersion, got %v", c.TLS.ProtocolMaxVersion)
} }
if c.TLS.CacheSize != 64 { if c.TLS.CacheSize != 64 {
@ -49,7 +49,7 @@ func TestTLSParseIncompleteParams(t *testing.T) {
func TestTLSParseWithOptionalParams(t *testing.T) { func TestTLSParseWithOptionalParams(t *testing.T) {
params := `tls cert.crt cert.key { params := `tls cert.crt cert.key {
protocols ssl3 tls1.2 protocols ssl3.0 tls1.2
ciphers RSA-3DES-EDE-CBC-SHA RSA-AES256-CBC-SHA ECDHE-RSA-AES128-GCM-SHA256 ciphers RSA-3DES-EDE-CBC-SHA RSA-AES256-CBC-SHA ECDHE-RSA-AES128-GCM-SHA256
cache 128 cache 128
}` }`
@ -61,11 +61,11 @@ func TestTLSParseWithOptionalParams(t *testing.T) {
} }
if c.TLS.ProtocolMinVersion != tls.VersionSSL30 { if c.TLS.ProtocolMinVersion != tls.VersionSSL30 {
t.Errorf("Expected 'ssl3' ProtocolMinVersion, got %#v", c.TLS.ProtocolMinVersion) t.Errorf("Expected 'ssl3.0 (0x0300)' as ProtocolMinVersion, got %#v", c.TLS.ProtocolMinVersion)
} }
if c.TLS.ProtocolMaxVersion != tls.VersionTLS12 { if c.TLS.ProtocolMaxVersion != tls.VersionTLS12 {
t.Errorf("Expected 'tls1.2' ProtocolMaxVersion, got %v", c.TLS.ProtocolMaxVersion) t.Errorf("Expected 'tls1.2 (0x0302)' as ProtocolMaxVersion, got %#v", c.TLS.ProtocolMaxVersion)
} }
if len(c.TLS.Ciphers) != 3 { if len(c.TLS.Ciphers) != 3 {