Update to new crypto/tls API.

This commit is contained in:
Mikkel Krautz 2011-04-06 18:16:31 +02:00
parent 9fe5a30ee3
commit 2eb5516d31

View file

@ -263,10 +263,10 @@ func (server *Server) handleAuthenticate(client *Client, msg *Message) {
client.Panic("Type assertion failed") client.Panic("Type assertion failed")
return return
} }
certs := tlsconn.PeerCertificates() state := tlsconn.ConnectionState()
if len(certs) > 0 { if len(state.PeerCertificates) > 0 {
hash := sha1.New() hash := sha1.New()
hash.Write(certs[0].Raw) hash.Write(state.PeerCertificates[0].Raw)
client.Hash = hex.EncodeToString(hash.Sum()) client.Hash = hex.EncodeToString(hash.Sum())
} }