Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ public static Result AddUserToGroups([PropertyTab] Input input, [PropertyTab] Co
if (string.IsNullOrWhiteSpace(connection.Host) || string.IsNullOrWhiteSpace(connection.User) || string.IsNullOrWhiteSpace(connection.Password))
throw new Exception("AddUserToGroups error: Connection parameters missing.");

LdapConnection conn = new();
LdapConnectionOptions ldco = new LdapConnectionOptions();

if (connection.IgnoreCertificates) {
ldco.ConfigureRemoteCertificateValidationCallback((sender, certificate, chain, errors) => true);
}

LdapConnection conn = new LdapConnection(ldco);

try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ public class Connection
/// <example>true</example>
public bool SecureSocketLayer { get; set; }

/// <summary>
/// Ignore server certificates
/// </summary>
public bool IgnoreCertificates { get; set; }

/// <summary>
/// Connection is protected by TLS.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<Version>1.0.0</Version>
<Version>1.1.0</Version>
<Authors>Frends</Authors>
<Copyright>Frends</Copyright>
<Company>Frends</Company>
Expand Down
8 changes: 7 additions & 1 deletion Frends.LDAP.CreateUser/Frends.LDAP.CreateUser/CreateUser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ public static Result CreateUser([PropertyTab] Input input, [PropertyTab] Connect
if (string.IsNullOrWhiteSpace(connection.Host) || string.IsNullOrWhiteSpace(connection.User) || string.IsNullOrWhiteSpace(connection.Password))
throw new Exception("Connection parameters missing.");

LdapConnection conn = new();
LdapConnectionOptions ldco = new LdapConnectionOptions();

if (connection.IgnoreCertificates) {
ldco.ConfigureRemoteCertificateValidationCallback((sender, certificate, chain, errors) => true);
}

LdapConnection conn = new LdapConnection(ldco);

try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ public class Connection
/// <example>true</example>
public bool SecureSocketLayer { get; set; }

/// <summary>
/// Ignore server certificates
/// </summary>
public bool IgnoreCertificates { get; set; }

/// <summary>
/// Connection is protected by TLS.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<Version>1.0.0</Version>
<Version>1.1.0</Version>
<Authors>Frends</Authors>
<Copyright>Frends</Copyright>
<Company>Frends</Company>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ public class Connection
/// <example>true</example>
public bool SecureSocketLayer { get; set; }

/// <summary>
/// Ignore server certificates
/// </summary>
public bool IgnoreCertificates { get; set; }

/// <summary>
/// Connection is protected by TLS.
/// </summary>
Expand Down
8 changes: 7 additions & 1 deletion Frends.LDAP.DeleteUser/Frends.LDAP.DeleteUser/DeleteUser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ public static Result DeleteUser([PropertyTab] Input input, [PropertyTab] Connect
if (string.IsNullOrWhiteSpace(connection.Host) || string.IsNullOrWhiteSpace(connection.User) || string.IsNullOrWhiteSpace(connection.Password))
throw new Exception("Connection parameters missing.");

LdapConnection conn = new();
LdapConnectionOptions ldco = new LdapConnectionOptions();

if (connection.IgnoreCertificates) {
ldco.ConfigureRemoteCertificateValidationCallback((sender, certificate, chain, errors) => true);
}

LdapConnection conn = new LdapConnection(ldco);

try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<Version>1.0.0</Version>
<Version>1.1.0</Version>
<Authors>Frends</Authors>
<Copyright>Frends</Copyright>
<Company>Frends</Company>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ public class Connection
/// <example>true</example>
public bool SecureSocketLayer { get; set; }

/// <summary>
/// Ignore server certificates
/// </summary>
public bool IgnoreCertificates { get; set; }

/// <summary>
/// Connection is protected by TLS.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<Version>1.0.0</Version>
<Version>1.1.0</Version>
<Authors>Frends</Authors>
<Copyright>Frends</Copyright>
<Company>Frends</Company>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ public static Result RemoveUserFromGroups([PropertyTab] Input input, [PropertyTa
if (string.IsNullOrWhiteSpace(connection.Host) || string.IsNullOrWhiteSpace(connection.User) || string.IsNullOrWhiteSpace(connection.Password))
throw new Exception("RemoveUserFromGroups error: Connection parameters missing.");

LdapConnection conn = new();
LdapConnectionOptions ldco = new LdapConnectionOptions();

if (connection.IgnoreCertificates) {
ldco.ConfigureRemoteCertificateValidationCallback((sender, certificate, chain, errors) => true);
}

LdapConnection conn = new LdapConnection(ldco);

try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ public class Connection
/// <example>true</example>
public bool SecureSocketLayer { get; set; }

/// <summary>
/// Ignore server certificates
/// </summary>
public bool IgnoreCertificates { get; set; }

/// <summary>
/// Connection is protected by TLS.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<Version>1.0.0</Version>
<Version>1.1.0</Version>
<Authors>Frends</Authors>
<Copyright>Frends</Copyright>
<Company>Frends</Company>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Security.Cryptography.X509Certificates;

namespace Frends.LDAP.SearchObjects;

Expand All @@ -25,7 +26,14 @@ public static Result SearchObjects([PropertyTab] Input input, [PropertyTab] Conn
if (string.IsNullOrWhiteSpace(connection.Host) || string.IsNullOrWhiteSpace(connection.User) || string.IsNullOrWhiteSpace(connection.Password))
throw new Exception("Connection parameters missing.");

var conn = new LdapConnection();

LdapConnectionOptions ldco = new LdapConnectionOptions();

if (connection.IgnoreCertificates) {
ldco.ConfigureRemoteCertificateValidationCallback((sender, certificate, chain, errors) => true);
}

LdapConnection conn = new LdapConnection(ldco);
var defaultPort = connection.SecureSocketLayer ? 636 : 389;
var atr = new List<string>();
var searchResults = new List<SearchResult>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ public class Connection
/// <example>true</example>
public bool SecureSocketLayer { get; set; }

/// <summary>
/// Ignore server certificates
/// </summary>
public bool IgnoreCertificates { get; set; }

/// <summary>
/// Connection is protected by TLS.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<Version>1.1.0</Version>
<Version>1.2.0</Version>
<Authors>Frends</Authors>
<Copyright>Frends</Copyright>
<Company>Frends</Company>
Expand Down
8 changes: 7 additions & 1 deletion Frends.LDAP.UpdateUser/Frends.LDAP.UpdateUser/UpdateUser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ public static Result UpdateUser([PropertyTab] Input input, [PropertyTab] Connect
if (input.Attributes.Length == 0)
throw new Exception("UpdateUser error: Attributes missing.");

LdapConnection conn = new();
LdapConnectionOptions ldco = new LdapConnectionOptions();

if (connection.IgnoreCertificates) {
ldco.ConfigureRemoteCertificateValidationCallback((sender, certificate, chain, errors) => true);
}

LdapConnection conn = new LdapConnection(ldco);

try
{
Expand Down