Encontrei a solução em Persuadindo o openldap a trabalhar com SSL no Ubuntu com cn = config
quais links para: link que tem a solução completa.
Então eu configurei um servidor openldap usando este guia aqui . Funcionou bem. Mas como eu quero usar o sssd eu também preciso que o TLS esteja funcionando para o ldap. Então olhei e segui a parte TLS do guia.
E eu nunca recebi nenhum erro e slapd começou bem novamente.
MAS. Não parece funcionar quando eu tento usar o ldap over tls.
root@server:~# ldapsearch -x -ZZ -H ldap://83.209.243.253 -b dc=daladevelop,dc=se
ldap_start_tls: Protocol error (2)
additional info: unsupported extended operation
Atribuindo o nível de depuração, alguns pontos retornam mais algumas informações:
root@server:~# ldapsearch -x -ZZ -H ldap://83.209.243.253 -b dc=daladevelop,dc=se -d 5
ldap_url_parse_ext(ldap://83.209.243.253)
ldap_create
ldap_url_parse_ext(ldap://83.209.243.253:389/??base)
ldap_extended_operation_s
ldap_extended_operation
ldap_send_initial_request
ldap_new_connection 1 1 0
ldap_int_open_connection
ldap_connect_to_host: TCP 83.209.243.253:389
ldap_new_socket: 3
ldap_prepare_socket: 3
ldap_connect_to_host: Trying 83.209.243.253:389
ldap_pvt_connect: fd: 3 tm: -1 async: 0
ldap_open_defconn: successful
ldap_send_server_request
ber_scanf fmt ({it) ber:
ber_scanf fmt ({) ber:
ber_flush2: 31 bytes to sd 3
ldap_result ld 0x7f25df51e220 msgid 1
wait4msg ld 0x7f25df51e220 msgid 1 (infinite timeout)
wait4msg continue ld 0x7f25df51e220 msgid 1 all 1
** ld 0x7f25df51e220 Connections:
* host: 83.209.243.253 port: 389 (default)
refcnt: 2 status: Connected
last used: Fri Jun 6 08:52:16 2014
** ld 0x7f25df51e220 Outstanding Requests:
* msgid 1, origid 1, status InProgress
outstanding referrals 0, parent count 0
ld 0x7f25df51e220 request count 1 (abandoned 0)
** ld 0x7f25df51e220 Response Queue:
Empty
ld 0x7f25df51e220 response count 0
ldap_chkResponseList ld 0x7f25df51e220 msgid 1 all 1
ldap_chkResponseList returns ld 0x7f25df51e220 NULL
ldap_int_select
read1msg: ld 0x7f25df51e220 msgid 1 all 1
ber_get_next
ber_get_next: tag 0x30 len 42 contents:
read1msg: ld 0x7f25df51e220 msgid 1 message type extended-result
ber_scanf fmt ({eAA) ber:
read1msg: ld 0x7f25df51e220 0 new referrals
read1msg: mark request completed, ld 0x7f25df51e220 msgid 1
request done: ld 0x7f25df51e220 msgid 1
res_errno: 2, res_error: <unsupported extended operation>, res_matched: <>
ldap_free_request (origid 1, msgid 1)
ldap_parse_extended_result
ber_scanf fmt ({eAA) ber:
ldap_parse_result
ber_scanf fmt ({iAA) ber:
ber_scanf fmt (}) ber:
ldap_msgfree
ldap_err2string
ldap_start_tls: Protocol error (2)
additional info: unsupported extended operation
ldap_free_connection 1 1
ldap_send_unbind
ber_flush2: 7 bytes to sd 3
ldap_free_connection: actually freed
Portanto, não há boas informações.
Em / var / log / syslog eu recebo:
Jun 6 08:55:42 master slapd[21383]: conn=1008 fd=23 ACCEPT from IP=83.209.243.253:56440 (IP=0.0.0.0:389)
Jun 6 08:55:42 master slapd[21383]: conn=1008 op=0 EXT oid=1.3.6.1.4.1.1466.20037
Jun 6 08:55:42 master slapd[21383]: conn=1008 op=0 do_extended: unsupported operation "1.3.6.1.4.1.1466.20037"
Jun 6 08:55:42 master slapd[21383]: conn=1008 op=0 RESULT tag=120 err=2 text=unsupported extended operation
Jun 6 08:55:42 master slapd[21383]: conn=1008 op=1 UNBIND
Jun 6 08:55:42 master slapd[21383]: conn=1008 fd=23 closed
Se eu fizer o portscan o host, recebo o seguinte:
Starting Nmap 6.40 ( http://nmap.org ) at 2014-06-06 08:56 CEST
Nmap scan report for h83-209-243-253.static.se.alltele.net (83.209.243.253)
Host is up (0.0072s latency).
Not shown: 996 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
389/tcp open ldap
636/tcp open ldapssl
Mas quando eu verifico certs
root@master:~# openssl s_client -connect daladevelop.se:636 -showcerts -state
CONNECTED(00000003)
SSL_connect:before/connect initialization
SSL_connect:unknown state
140244859233952:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:177:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 317 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
---
E eu sinto que estou claramente em águas profundas sem saber aonde ir a partir daqui. Anny dá dicas sobre o que fazer ou para obter um melhor registro de depuração ...
EDIT: Esta é a minha configuração slapcated de cn = config e não menciona nada sobre o TLS.
Eu inseri meu certinfo.ldif:
root@master:~# cat certinfo.ldif
dn: cn=config
add: olcTLSCACertificateFile
olcTLSCACertificateFile: /etc/ssl/certs/cacert.pem
-
add: olcTLSCertificateFile
olcTLSCertificateFile: /etc/ssl/certs/daladevelop_slapd_cert.pem
-
add: olcTLSCertificateKeyFile
olcTLSCertificateKeyFile: /etc/ssl/private/daladevelop_slapd_key.pem
e ao fazer isso eu só tenho isso como uma resposta.
root@master:~# sudo ldapmodify -Y EXTERNAL -H ldapi:/// -f certinfo.ldif
SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
modifying entry "cn=config"
Então ainda não é mais sábio.
Encontrei a solução em Persuadindo o openldap a trabalhar com SSL no Ubuntu com cn = config
quais links para: link que tem a solução completa.
Tags tls openssl openldap linux ubuntu-14.04