Howard Chu wrote:
Quanah Gibson-Mount wrote:
--On Tuesday, May 09, 2017 11:01 AM +0100 Howard Chu hyc@symas.com wrote:
if I remove the check against the "localhost" name, things succeed as expected.
Fwiw, I routinely test with a localhost cert, and this check has never tripped for me. But my ldap_int_hostname is also "localhost" - apparently something on your system insists that your hostname is "u16build".
One of the main tenants of the test suite is that it be portable. I think mandating that anyone who wants to run the test suite must use a host with a hostname set to "localhost" is untennable. Because of this bug, the test suite will have to have a dependency on the "openssl" command line binary so that it can generate certs based on the hostname of the system where it is being run. Without this problematic code, we could simple check in pre-generated certs, removing that dependency.
Well, technically your certDN is invalid. The cn is supposed to be the FQDN, and in your case it must be "u16build.xxxx.yyy" or somesuch.
Hmm, this reminds me of Google Chrome enforcing at least *one* dot be used in a HTTP cookie domain part. Otherwise it does not accept the cookie. For this purpose I have in my /etc/hosts:
127.0.0.1 localhost localhost.localhost localhost.localdomain
Does your example above mean that you expect at least two dots? That would be way too strict.
Also note that TLS client implementations today don't care about the subject-DN's CN attribute if the FQDN or IP address used by the client to establish the connection already matched one of the subjectAltName values. AFAIK TLS client implementors are even encouraged to rather ignore the misused CN attribute (which is IMO the right direction today).
=> strictly requiring the CN attribute to contain a FQDN at all is IMO wrong if subjectAltName already matched
"subjectAltName" means *alternative* name. It is totally correct for libldap to reject your cert with a hostname mismatch when the cert cn is incorrect.
Human language can cause misunderstandings. So maybe I misread your statement. But I'm reading your sentence that the CN must always match or at least be a FQDN even if a subjectAltName value already matched.
Ciao, Michael.