Skip to content

Commit 09cc4bb

Browse files
committed
Remove support for SSL 3.0.
It's obsolete, actively dangerous, and support has been removed from all major browsers.
1 parent c41a68d commit 09cc4bb

File tree

2 files changed

+11
-17
lines changed

2 files changed

+11
-17
lines changed

sni.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ func parseHello(b []byte) ([]byte, error) {
105105
return nil, fmt.Errorf("ClientHello has unsupported version %d.%d", b[0], b[1])
106106
}
107107
switch b[1] {
108-
case 0, 1, 2, 3:
109-
// SSL 3, TLS 1.0, TLS 1.1, TLS 1.2
108+
case 1, 2, 3:
109+
// TLS 1.0, TLS 1.1, TLS 1.2
110110
default:
111111
return nil, fmt.Errorf("TLS record has unsupported version %d.%d", b[0], b[1])
112112
}
@@ -199,8 +199,8 @@ func handshakeRecord(r io.Reader) ([]byte, int, error) {
199199
return nil, 0, fmt.Errorf("TLS record has unsupported version %d.%d", hdr.Major, hdr.Minor)
200200
}
201201
switch hdr.Minor {
202-
case 0, 1, 2, 3:
203-
// SSL 3, TLS 1.0, TLS 1.1, TLS 1.2
202+
case 1, 2, 3:
203+
// TLS 1.0, TLS 1.1, TLS 1.2
204204
default:
205205
return nil, 0, fmt.Errorf("TLS record has unsupported version %d.%d", hdr.Major, hdr.Minor)
206206
}

sni_test.go

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,6 @@ func TestHandshakeRecord(t *testing.T) {
151151
out []byte
152152
tlsver int
153153
}{
154-
{
155-
// SSL 3.0, 1b packet
156-
[]byte{22, 3, 0, 0, 1, 3},
157-
[]byte{3},
158-
0,
159-
},
160154
{
161155
// TLS 1.0, 1b packet
162156
[]byte{22, 3, 1, 0, 1, 3},
@@ -229,6 +223,12 @@ func TestHandshakeRecord(t *testing.T) {
229223
nil,
230224
0,
231225
},
226+
{
227+
// Obsolete SSL 3.0
228+
[]byte{22, 3, 0, 0, 1, 3},
229+
nil,
230+
0,
231+
},
232232
}
233233

234234
for _, test := range tests {
@@ -308,13 +308,7 @@ func TestParseHello(t *testing.T) {
308308
true,
309309
},
310310
{
311-
// First valid packet. SSL 3.0, no extensions present.
312-
packet([]byte{1, 0, 0, 73, 3, 0}, slice(32), []byte{32}, slice(32), []byte{0, 2, 1, 2, 1, 0}),
313-
nil,
314-
false,
315-
},
316-
{
317-
// TLS 1.0, no extensions present.
311+
// First valid packet. TLS 1.0, no extensions present.
318312
packet([]byte{1, 0, 0, 73, 3, 1}, slice(32), []byte{32}, slice(32), []byte{0, 2, 1, 2, 1, 0}),
319313
nil,
320314
false,

0 commit comments

Comments
 (0)