1
0
mirror of https://github.com/golang/go synced 2024-11-24 03:40:16 -07:00
go/src
Adam Langley fca335e91a crypto/tls: enforce that either ServerName or InsecureSkipVerify be given.
crypto/tls has two functions for creating a client connection: Dial,
which most users are expected to use, and Client, which is the
lower-level API.

Dial does what you expect: it gives you a secure connection to the host
that you specify and the majority of users of crypto/tls appear to work
fine with it.

Client gives more control but needs more care. Specifically, if it
wasn't given a server name in the tls.Config then it didn't check that
the server's certificates match any hostname - because it doesn't have
one to check against. It was assumed that users of the low-level API
call VerifyHostname on the certificate themselves if they didn't supply
a hostname.

A review of the uses of Client both within Google and in a couple of
external libraries has shown that nearly all of them got this wrong.

Thus, this change enforces that either a ServerName or
InsecureSkipVerify is given. This does not affect tls.Dial.

See discussion at https://groups.google.com/d/msg/golang-nuts/4vnt7NdLvVU/b1SJ4u0ikb0J.

Fixes #7342.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/67010043
2014-02-21 15:56:41 -05:00
..
cmd runtime: use goc2c as much as possible 2014-02-20 15:58:47 -05:00
lib9 lib9: fix Solaris build 2014-02-13 20:30:42 +01:00
libbio lib9: enable on Plan 9 2014-02-13 20:06:41 +01:00
liblink cmd/gc: rename AFATVARDEF to AVARDEF 2014-02-13 22:17:22 -05:00
libmach
pkg crypto/tls: enforce that either ServerName or InsecureSkipVerify be given. 2014-02-21 15:56:41 -05:00
all.bash
all.bat
all.rc
clean.bash
clean.bat
clean.rc
make.bash
make.bat
Make.dist
make.rc lib9: enable on Plan 9 2014-02-13 20:06:41 +01:00
race.bash
race.bat
run.bash cmd/gc: fix handling of append with -race. 2014-02-19 08:19:27 +01:00
run.bat cmd/gc: fix handling of append with -race. 2014-02-19 08:19:27 +01:00
run.rc
sudo.bash