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

LdapIgnoreTlsErrors and LdapIgnoreTlsValidation warnings are backwards #394

@JonathonReinhart

Description

@JonathonReinhart

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");

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions