Add TLSConnectionState() method to forked ldap package

This commit is contained in:
Matthew McPherrin
2017-02-18 23:45:16 -08:00
parent 2cd70c1d10
commit 84fb87afa5
+9
View File
@@ -264,6 +264,15 @@ func (l *Conn) StartTLS(config *tls.Config) error {
return nil
}
// TLSConnectionState returns the current connection's TLS ConnectionState, or an error if not TLS.
func (l *Conn) TLSConnectionState() (*tls.ConnectionState, error) {
if !l.isTLS {
return nil, errors.New("ldap: Cannot get TLS Connection State for non-TLS connection")
}
state := l.conn.(*tls.Conn).ConnectionState()
return &state, nil
}
func (l *Conn) sendMessage(packet *ber.Packet) (*messageContext, error) {
return l.sendMessageWithFlags(packet, 0)
}