Pythonでldapを設定しようとしています。実行すると、次のよう./manage.py syncldap
になります。
SERVER_DOWN: {'info': 'TLS: hostname does not match CN in peer certificate', 'desc': "Can't contact LDAP server"}
ローカル マシンで同じコードベースに取り組んでいる他の人々は、何の問題も抱えていないようです。何かご意見は?
Check the CN from Subject of server cert
openssl x509 -noout -text -in imsva_cert.pem | grep Subject
Subject: C=en, ST=xx, O=yy, OU=zz, CN=test.com
The "hostname" in the error is to say the host name in your command to access LDAP server, so please just use host test.com, e.g.
ldapsearch -H "ldaps://test.com:636" ...
Also don't forget add test.com in your DNS server to make sure ldapsearch can get the A record for host test.com. Specify the info in /etc/hosts is a easy way.