ldaps with self signed cert

All about webserver configurations, PHP and databases.

Moderator: Thorsten

Post Reply
bpoulain
Posts: 2
Joined: Wed Mar 12, 2025 11:42 am

ldaps with self signed cert

Post by bpoulain »

Hi all,

I am using phpmyfaq v3.2.9 with docker.

I would like to use ldaps with a self-signed certificate.

My ldap.php:

Code: Select all

$PMF_LDAP['ldap_server'] = 'ldaps://ldap.mydomain';
$PMF_LDAP['ldap_port'] = 636;
$PMF_LDAP['ldap_user'] = 'cn=ldap_search,dc=mydomain';
$PMF_LDAP['ldap_password'] = 'xxxxx';
The certificate of the authority is well known at the OS level.

Code: Select all

# curl -v ldaps://ldap.mydomain:636
*   Trying xxx:636...
* Connected to ldap.mydomain (xxx) port 636 (#0)
* successfully set certificate verify locations:
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* Server certificate:
*  subject: CN=ldap.mydomain; C=xx; ST=xx; L=xx; O=xx; OU=xx
*  start date: Jan 20 09:36:42 2025 GMT
*  expire date: Jan 20 09:36:42 2026 GMT
*  subjectAltName: host "ldap.mydomain" matched cert's "ldap.mydomain"
*  issuer: CN=SELF-CA; C=xx; ST=xx; L=xx; O=xx; OU=xx
*  SSL certificate verify ok.
* LDAP local: ldaps://ldap.mydomain:636/
DN: 
        objectClass: top
        objectClass: OpenLDAProotDSE
* Connection #0 to host ldap.mydomain left intact
However I see this message in the log phpmyfaq.log:

Code: Select all

phpmyfaq.ERROR: Unable to bind to LDAP server (Error: Can't contact LDAP server). [] []
Can you help me ?

Thx
bpoulain
Posts: 2
Joined: Wed Mar 12, 2025 11:42 am

Re: ldaps with self signed cert

Post by bpoulain »

Problem solved !

Juste add /etc/ldap/ldap.conf with:

Code: Select all

TLS_REQCERT never
Thorsten
Posts: 15701
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: ldaps with self signed cert

Post by Thorsten »

Hi,

I'll add that to our documentation.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply