From 261e5b111f795b8fdc66b8ce3cf70943cecca1ae Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Wed, 21 Oct 2026 08:33:00 +0200 Subject: [PATCH] ldap: use ldaps:// scheme when adding LDAP config if SSL is enabled addConfigurationInternal always built the connectivity-test provider URL with the plain ldap:// scheme, even when domain/global SSL (truststore) settings are configured, unlike LdapConfiguration.getProviderUrl() used elsewhere which already selects ldaps:// based on SSL status. --- .../main/java/org/apache/cloudstack/ldap/LdapManagerImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/user-authenticators/ldap/src/main/java/org/apache/cloudstack/ldap/LdapManagerImpl.java b/plugins/user-authenticators/ldap/src/main/java/org/apache/cloudstack/ldap/LdapManagerImpl.java index 7ee02b511b34..33c4733b8ddf 100644 --- a/plugins/user-authenticators/ldap/src/main/java/org/apache/cloudstack/ldap/LdapManagerImpl.java +++ b/plugins/user-authenticators/ldap/src/main/java/org/apache/cloudstack/ldap/LdapManagerImpl.java @@ -180,7 +180,8 @@ private LdapConfigurationResponse addConfigurationInternal(final String hostname if (configuration == null) { LdapContext context = null; try { - final String providerUrl = "ldap://" + hostname + ":" + port; + final String protocol = LdapConfiguration.getSSLStatus(domainId) ? "ldaps://" : "ldap://"; + final String providerUrl = protocol + hostname + ":" + port; context = _ldapContextFactory.createBindContext(providerUrl,domainId); configuration = new LdapConfigurationVO(hostname, port, domainId); _ldapConfigurationDao.persist(configuration);