func (d *DefaultsBackend) startTLS(w ldap.ResponseWriter, m *ldap.Message) { tlsconfig, _ := d.getTLSconfig() tlsConn := tls.Server(m.Client.GetConn(), tlsconfig) res := ldap.NewExtendedResponse(ldap.LDAPResultSuccess) res.SetResponseName(ldap.NoticeOfStartTLS) w.Write(res) if err := tlsConn.Handshake(); err != nil { d.Log.Error("StartTLS Handshake error", log.Ctx{"error": err}) res.SetDiagnosticMessage(fmt.Sprintf("StartTLS Handshake error : \"%s\"", err.Error())) res.SetResultCode(ldap.LDAPResultOperationsError) w.Write(res) return } m.Client.SetConn(tlsConn) d.Log.Debug("StartTLS OK") }
func (d *DebugBackend) Extended(w ldap.ResponseWriter, m *ldap.Message) { r := m.GetExtendedRequest() dump(r) res := ldap.NewExtendedResponse(ldap.LDAPResultSuccess) w.Write(res) }
func (l *LdifBackend) Extended(w ldap.ResponseWriter, m *ldap.Message) { r := m.GetExtendedRequest() l.Log.Debug("Extended request received", log.Ctx{"name": r.RequestName(), "value": r.RequestValue()}) res := ldap.NewExtendedResponse(ldap.LDAPResultSuccess) w.Write(res) }