File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -2363,9 +2363,10 @@ InitializeLDAPConnection(Port *port, LDAP **ldap)
2363
2363
if (scheme == NULL )
2364
2364
scheme = "ldap" ;
2365
2365
#ifdef WIN32
2366
- * ldap = ldap_sslinit (port -> hba -> ldapserver ,
2367
- port -> hba -> ldapport ,
2368
- strcmp (scheme , "ldaps" ) == 0 );
2366
+ if (strcmp (scheme , "ldaps" ) == 0 )
2367
+ * ldap = ldap_sslinit (port -> hba -> ldapserver , port -> hba -> ldapport , 1 );
2368
+ else
2369
+ * ldap = ldap_init (port -> hba -> ldapserver , port -> hba -> ldapport );
2369
2370
if (!* ldap )
2370
2371
{
2371
2372
ereport (LOG ,
@@ -2489,6 +2490,11 @@ InitializeLDAPConnection(Port *port, LDAP **ldap)
2489
2490
#define LDAP_NO_ATTRS "1.1"
2490
2491
#endif
2491
2492
2493
+ /* Not all LDAP implementations define this. */
2494
+ #ifndef LDAPS_PORT
2495
+ #define LDAPS_PORT 636
2496
+ #endif
2497
+
2492
2498
/*
2493
2499
* Return a newly allocated C string copied from "pattern" with all
2494
2500
* occurrences of the placeholder "$username" replaced with "user_name".
You can’t perform that action at this time.
0 commit comments