mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
accounts: Add SASL EXTERNAL handler
This commit is contained in:
parent
70665850aa
commit
b5e7d8968f
4 changed files with 121 additions and 40 deletions
|
|
@ -16,7 +16,7 @@ import (
|
|||
)
|
||||
|
||||
var (
|
||||
errNotTls = errors.New("Not a TLS connection")
|
||||
errNotTLS = errors.New("Not a TLS connection")
|
||||
errNoPeerCerts = errors.New("Client did not provide a certificate")
|
||||
)
|
||||
|
||||
|
|
@ -48,9 +48,12 @@ func (socket *Socket) Close() {
|
|||
func (socket *Socket) CertFP() (string, error) {
|
||||
var tlsConn, isTLS = socket.conn.(*tls.Conn)
|
||||
if !isTLS {
|
||||
return "", errNotTls
|
||||
return "", errNotTLS
|
||||
}
|
||||
|
||||
// ensure handehake is performed
|
||||
tlsConn.Handshake()
|
||||
|
||||
peerCerts := tlsConn.ConnectionState().PeerCertificates
|
||||
if len(peerCerts) < 1 {
|
||||
return "", errNoPeerCerts
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue