feat(auth): ad.max_tls_version zum Deckeln der angebotenen TLS-Version
Alte Schannel-Stacks brechen an einem TLS-1.3-ClientHello kommentarlos ab: sie nehmen die TCP-Verbindung an, lesen den ClientHello und setzen zurueck, ohne ein Zertifikat zu schicken. Herunterhandeln hilft dann nicht — TLS 1.3 darf gar nicht erst angeboten werden. max_tls_version (Default 1.3) deckelt die Hoechstversion; die Validierung lehnt eine Hoechstversion unterhalb der Mindestversion ab. check erkennt zusaetzlich zurueckgesetzte Verbindungen und nennt die beiden plausiblen Ursachen: fehlendes LDAPS-Zertifikat auf dem Server oder TLS-1.3-Inkompatibilitaet. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NBHF4R9EAejDJUMdwr6C68
This commit is contained in:
parent
fd88251e07
commit
11a3ec2e5f
10 changed files with 136 additions and 10 deletions
|
|
@ -34,6 +34,8 @@ type Options struct {
|
|||
// MinTLSVersion ist die niedrigste akzeptierte TLS-Version (Konstante aus
|
||||
// crypto/tls). 0 bedeutet TLS 1.2.
|
||||
MinTLSVersion uint16
|
||||
// MaxTLSVersion deckelt die angebotene TLS-Version. 0 bedeutet TLS 1.3.
|
||||
MaxTLSVersion uint16
|
||||
Timeout time.Duration
|
||||
|
||||
// Dial ist injizierbar; nil = echte LDAP-Verbindung.
|
||||
|
|
@ -76,7 +78,7 @@ func NewAD(opts Options) (*AD, error) {
|
|||
opts.Port = 636
|
||||
}
|
||||
if opts.Dial == nil {
|
||||
opts.Dial = realDialer(opts.Port, opts.TLSMode, opts.CAFile, opts.MinTLSVersion, opts.Timeout)
|
||||
opts.Dial = realDialer(opts.Port, opts.TLSMode, opts.CAFile, opts.MinTLSVersion, opts.MaxTLSVersion, opts.Timeout)
|
||||
}
|
||||
a := &AD{opts: opts}
|
||||
if opts.OnFailover != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue