crypto/tls: extensions and Next Protocol Negotiation

Add support for TLS extensions in general and Next Protocol
Negotiation in particular.

R=rsc
CC=golang-dev
https://golang.org/cl/181045
This commit is contained in:
Adam Langley 2009-12-23 11:13:09 -08:00
parent 7c9111434a
commit 9ebb59634e
9 changed files with 379 additions and 28 deletions

View file

@ -184,7 +184,7 @@ func (h *clientHandshake) loop(writeChan chan<- interface{}, controlChan chan<-
return
}
controlChan <- ConnectionState{true, "TLS_RSA_WITH_RC4_128_SHA", 0}
controlChan <- ConnectionState{HandshakeComplete: true, CipherSuite: "TLS_RSA_WITH_RC4_128_SHA"}
// This should just block forever.
_ = h.readHandshakeMsg()
@ -218,7 +218,7 @@ func (h *clientHandshake) error(e alertType) {
for _ = range h.msgChan {
}
}()
h.controlChan <- ConnectionState{false, "", e}
h.controlChan <- ConnectionState{Error: e}
close(h.controlChan)
h.writeChan <- alert{alertLevelError, e}
}