inejge / ldap3

A pure-Rust LDAP library using the Tokio stack
Apache License 2.0
220 stars 38 forks source link

Allow tls with ip #24

Closed kxt closed 6 years ago

kxt commented 6 years ago

Fixes #23

inejge commented 6 years ago

Thanks for the PR! Before going further, I'd like to see the changes tested against valid certificates, preferably also self-signed, which have:

  1. Subject with CN=<ip address>, no SAN,
  2. Subject with CN=<ip address>, SAN with IP address only,
  3. Subject with CN=<hostname>, SAN with IP address only,
  4. Subject with CN=<hostname>, SAN with DNS and IP address.

OpenSSL backend as a minimum, SChannel (Windows) and Secure Transport (macOS) a bonus.

Ldap::connect_ssl() would need a documentation update with the summary of client behavior in those tests.

Also, the commit which removes mut from the helper binding in protocol.rs is unrelated to TLS connections by IP address, so I'd prefer to leave it out of this PR.

inejge commented 6 years ago

I finally had the time to look into this myself, with the caveat that I could only do the tests on Linux + OpenSSL.

I'll be merging the PR, including the unrelated mut fixup. Thanks! (I'm not too happy about the delay, but I believe that the PR could've been merged sooner if I'd had the results of relevant tests.)