저는 LinuxMint와 함께 로컬에서 작업하고 virtualbox에 openldap을 사용하여 UbuntuServer를 설치했습니다. 이제 구성 가이드를 따르십시오. http://help.ubuntu-it.org/12.04/server/serverguide/it/ubuntu-1204-server.pdf TLS/SSL 인증. 나는 클라이언트 (리눅스 민트)에 XAMPP를 설치하고 난에 /etc/ldap/ldap.conf 구성 :PHP 인증서 SSL for OpenLdap 설정
TLS_CACERT /etc/ssl/certs/192.168.1.46_slapd_cert.pem
TLS_REQCERT never
내가 PHP 함수와 연결을 시도 :
<?php
// This code goes directly to the 636 SSL port
$ldaphost = "ldaps://192.168.1.46";
$ldapUsername = "cn=admin,dc=company,dc=com";
$ldapPassword = "secret";
$ds = ldap_connect($ldaphost);
if(!ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)){
print "Could not set LDAPv3\r\n";
}
else {
// now we need to bind to the ldap server
$bth = ldap_bind($ds, $ldapUsername, $ldapPassword) or die("\r\nCould not connect to LDAP server\r\n");
}
?>
하지만 작품. .
난 내 터미널에서 시도하는 경우 :
작동ldapsearch -x -H ldaps://192.168.1.46 -b "cn=company,cn=com"
! 하지만 PHP를 통해 왜? .. 난 에 CentOS에서 나는 아파치/PHP과 openldap 작업/옵션/lampp를을/etc/OpenLDAP를하지만 결과에 ldap.conf ..