goharbor / harbor

An open source trusted cloud native registry project that stores, signs, and scans content.
https://goharbor.io
Apache License 2.0
23.86k stars 4.74k forks source link

LDAP handshake failure from version 2.11 #20691

Open dajose opened 3 months ago

dajose commented 3 months ago

Starting on version 2.11 I can't connect to ldaps, it works with the exact same configuration on version 2.10.2

Expected behavior and actual behavior:

Steps to reproduce the problem: Upgrade harbor from 2.10.2 to 2.11.0, and configure LDAP auth

Versions: Please specify the versions of following systems.

DENISKI commented 3 months ago

The same issue. 2024-07-04T17:20:48Z [WARNING] [/core/auth/ldap/ldap.go:62]: ldap connection fail: LDAP Result Code 200 "Network Error": remote error: tls: handshake failure 2024-07-04T17:20:48Z [ERROR] [/core/controllers/base.go:101]: Error occurred in UserLogin: LDAP Result Code 200 "Network Error": remote error: tls: handshake failure

wy65701436 commented 3 months ago

What's your AD? And the version of your AD? It supposed to be caused by https://github.com/go-gitea/gitea/issues/31228.

stonezdj commented 3 months ago

@dajose @DENISKI You could try this workaround:

Update common/config/core/env, add an environment variable

GODEBUG="tlsrsakex=1"

Restart Harbor and try connect LDAP again.

vaz-ar commented 3 months ago

@dajose @DENISKI You could try this workaround:

Update common/config/core/env, add an environment variable

GODEBUG="tlsrsakex=1"

Restart Harbor and try connect LDAP again.

Any idea where to put that to make it persistent ? If I run the harbor install.sh script again after modifying common/config/core/env, the file is overwritten

dajose commented 2 months ago

@dajose @DENISKI You could try this workaround:

Update common/config/core/env, add an environment variable

GODEBUG="tlsrsakex=1"

Restart Harbor and try connect LDAP again.

@stonezdj thanks for that workaround. I confirm it works with that set.

I had some trouble understanding the issue @wy65701436 pointed out. Does it says that now tls 1.2 support is disabled by default on the golibrary used to perform the connection?

@vaz-ar I can't answer yours, because I am using harbor via a helm installation. So in my case I edited the values files adding it to the "extraEnvVars" field under core.

stonezdj commented 2 months ago

Golang 1.22 still supports tls 1.2, but it removed some weak TLS cipher suites that start with TLSRSA*.

stonezdj commented 2 months ago

@dajose @DENISKI You could try this workaround: Update common/config/core/env, add an environment variable

GODEBUG="tlsrsakex=1"

Restart Harbor and try connect LDAP again.

Any idea where to put that to make it persistent ? If I run the harbor install.sh script again after modifying common/config/core/env, the file is overwritten

You should manually update the env file after run ./install.sh

dajose commented 2 months ago

Golang 1.22 still supports tls 1.2, but it removed some weak TLS cipher suites that start with TLSRSA*.

Thanks for explaining it to me.

That being the case, I am ok with closing this issue

github-actions[bot] commented 3 weeks ago

This issue is being marked stale due to a period of inactivity. If this issue is still relevant, please comment or remove the stale label. Otherwise, this issue will close in 30 days.