2013-10-08 2 views
0

저는 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 ..

답변

1

를 구성하려고합니다. 어쩌면 그것은 유사 할 것입니다.

  1. ldap.conf 내가 구성
  2. /etc/ldap.conf에 * TLS_REQCERT 허용 *
  3. 내가 같은 디렉토리에 심볼릭 링크로 인증서의 해시를 생성 할 수있다 : 우분투 (ldapsupport없이)이 기능을 존재 내에서
ln -s /etc/ssl/certs/192.168.1.46_slapd_cert.pem `openssl x509 -hash -noout -in /etc/ssl/certs/192.168.1.46_slapd_cert.pem`.0 

c_rehash. 내가 거기 REVOKE 목록을 설치하는 경우, 나는이 방법으로이 기능을 모든 revokelists을 재탕해야 :

cd /etc/ssl/certs/ 
c_rehash /etc/ssl/certs/ 

은 아마 당신의 CA에 대한 올바른 해시를 생성합니다.