Skip to content
This repository has been archived by the owner on Jun 2, 2023. It is now read-only.

LdapIgnoreTlsErrors and LdapIgnoreTlsValidation warnings are backwards #394

Closed
JonathonReinhart opened this issue Oct 28, 2019 · 4 comments
Assignees

Comments

@JonathonReinhart
Copy link

As of version 4.2.1, these warnings appear to be backwards:

if (!_options.LdapIgnoreTlsErrors)
    _logger.LogWarning($"option [{nameof(_options.LdapIgnoreTlsErrors)}] is ENABLED; invalid certificates will be allowed");
else if (!_options.LdapIgnoreTlsValidation)
    _logger.LogWarning($"option [{nameof(_options.LdapIgnoreTlsValidation)}] is ENABLED; untrusted certificate roots will be allowed");

As far as I can tell, these options default to false, and the error message is printed even though I did not set the option:

warn: Zyborg.PassCore.PasswordProvider.LDAP.LdapPasswordChangeProvider[0]
      option [LdapIgnoreTlsErrors] is ENABLED; invalid certificates will be allowed

I think the solution is to remove the ! on both conditionals:

if (_options.LdapIgnoreTlsErrors)
    _logger.LogWarning($"option [{nameof(_options.LdapIgnoreTlsErrors)}] is ENABLED; invalid certificates will be allowed");
else if (_options.LdapIgnoreTlsValidation)
    _logger.LogWarning($"option [{nameof(_options.LdapIgnoreTlsValidation)}] is ENABLED; untrusted certificate roots will be allowed");
@JonathonReinhart
Copy link
Author

Tangentially related to #263

@geoperez
Copy link
Member

geoperez commented Nov 2, 2019

Today I'm going to verify your suggestion. Thanks!

@geoperez
Copy link
Member

geoperez commented Nov 2, 2019

@JonathonReinhart can you take a look in my last commit?

@geoperez geoperez self-assigned this Nov 2, 2019
@JonathonReinhart
Copy link
Author

I haven't tried it, but that seems to make more sense. Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants