go-ldap / ldap

Basic LDAP v3 functionality for the GO programming language.
Other
2.19k stars 352 forks source link

Revert #499: Mark public Start function as deprecated #508

Closed cpuschma closed 2 months ago

cpuschma commented 2 months ago

This reverts the prematurely deprecation of the Start function, because some requirements cannot be implemented via the DialOpts (see #507). This PR reverts this, but adds a warning because of the original intention (see #356)

seveas commented 2 months ago

Thanks @cpuschma! When will this be released? I have some codebases now failing to build, as the linter does not like the use of deprecated functions. For the record, our usecase for this is full control over TLS in a piece of code that's part of our TLS certificate expiration checker:

func (c *ldapCheck) check(ctx context.Context, stats statsd.ClientInterface) *statsd.ServiceCheck {
    ...
    conf := newTLSConfig(c.tlsServerName)
    tlsconn, err := tls.DialWithDialer(&net.Dialer{Timeout: c.timeout}, "tcp4", c.addr, conf)
    if err != nil {
        ....
    }
    defer tlsconn.Close()
    conn := ldap.NewConn(tlsconn, true)
    conn.Start()
    defer conn.Close()

    state, ok := conn.TLSConnectionState()
    if ok {
        ....
    }
    return sc
}
cpuschma commented 2 months ago

@seveas I still wanted to fix #506 and fix it in the same new release, but I'm not making any progress so far, but have been able to recreate the problem so far. @johnweldon Is it OK for you if I publish a release for the withdrawn commit or do you want to postpone it?

johnweldon commented 2 months ago

Go ahead and publish a release. Thanks @cpuschma