mirror of
https://github.com/freedbygrace/ActiveDirectoryToRestApi.git
synced 2026-07-26 11:28:20 +00:00
Add option to work with ldapS on Linux
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
<UserSecretsId>d52504e9-ea6e-4152-a52e-467ca002e47c</UserSecretsId>
|
||||
<AssemblyVersion>$(PackageVersion)</AssemblyVersion>
|
||||
<FileVersion>$(PackageVersion)</FileVersion>
|
||||
<Version>1.0.0.3</Version>
|
||||
<Version>1.0.0.4</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
builder.Services.AddControllers();
|
||||
@@ -36,11 +38,15 @@ builder.Services.AddSingleton(provider =>
|
||||
{
|
||||
AuthType = AuthType.Basic
|
||||
};
|
||||
if (configs.UseSSL)
|
||||
if (configs.UseSSL && RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
{
|
||||
ldapConnection.SessionOptions.SecureSocketLayer = true;
|
||||
ldapConnection.SessionOptions.VerifyServerCertificate = (con, cert) => true;
|
||||
}
|
||||
if (configs.UseSSL && RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||
{
|
||||
ldapConnection.SessionOptions.SecureSocketLayer = true;
|
||||
}
|
||||
ldapConnection.SessionOptions.ReferralChasing = ReferralChasingOptions.None;
|
||||
ldapConnection.Bind();
|
||||
return ldapConnection;
|
||||
|
||||
Reference in New Issue
Block a user