note 127351 added to function.ldap-bind

From: Date: Wed, 27 Jul 2022 17:33:38 +0000
Subject: note 127351 added to function.ldap-bind
Groups: php.notes 
Request: Send a blank email to php-notes+get-219068@lists.php.net to get a copy of this message
LDAPS over SSH port forwarding. It may be that, when developing/debugging, you don't have direct access to the LDAP server. You can use SSH port-forwarding, but you need to disable the cert checks temporarily. Here's the easiest way to do it. //Enable debugging, so you can see what's failing. ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL,7); //Disable the TLS certificate check (it will mismatch on the domain). Either //edit /etc/ldap/ldap.conf and set "TLS_REQCERT never", or in your script: putenv('LDAPTLS_REQCERT=never'); //Point your ldaps url at localhost. E.g. $ldap_url = "ldaps://localhost:63600"; //Do the SSH port forward (in another terminal). E.g. ssh -L 63600:your_real_ldap_server:636 your_proxy_server //And continue as normal... ldap_connect($ldap_url); ---- Server IP: 45.112.84.4 Probable Submitter: 80.90.5.135 (proxied: 82.8.243.31) ---- Manual Page -- https://php.net/manual/en/function.ldap-bind.php Edit -- https://main.php.net/note/edit/127351 Del: integrated -- https://main.php.net/note/delete/127351/integrated Del: useless -- https://main.php.net/note/delete/127351/useless Del: bad code -- https://main.php.net/note/delete/127351/bad+code Del: spam -- https://main.php.net/note/delete/127351/spam Del: non-english -- https://main.php.net/note/delete/127351/non-english Del: in docs -- https://main.php.net/note/delete/127351/in+docs Del: other reasons-- https://main.php.net/note/delete/127351 Reject -- https://main.php.net/note/reject/127351 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#219068) next »