mirror of
https://github.com/mumble-voip/grumble.git
synced 2025-12-28 21:51:57 -08:00
Enforce certhash-based bans and add strong certificate checking (non-working for now, crypto/tls doesn't verify client certificates)
This commit is contained in:
parent
0b1794f9b5
commit
1240fe3eb6
3 changed files with 55 additions and 20 deletions
10
client.go
10
client.go
|
|
@ -7,6 +7,7 @@ package main
|
|||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"crypto/tls"
|
||||
"encoding/binary"
|
||||
"goprotobuf.googlecode.com/hg/proto"
|
||||
"grumble/blobstore"
|
||||
|
|
@ -125,6 +126,15 @@ func (client *Client) ShownName() string {
|
|||
return client.Username
|
||||
}
|
||||
|
||||
// Check whether the client's certificate is
|
||||
// verified.
|
||||
func (client *Client) IsVerified() bool {
|
||||
tlsconn := client.conn.(*tls.Conn)
|
||||
state := tlsconn.ConnectionState()
|
||||
client.Printf("%v", state.VerifiedChains)
|
||||
return len(state.VerifiedChains) > 0
|
||||
}
|
||||
|
||||
// Log a panic and disconnect the client.
|
||||
func (client *Client) Panic(v ...interface{}) {
|
||||
client.Print(v)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue