Open nickjmcclure opened 3 months ago
Tagging subscribers to this area: @dotnet/area-system-directoryservices, @jay98014 See info in area-owners.md if you want to be subscribed.
I assume this is on Windows since you mention AccountManagement.
I know S.DS.Protocols has https://learn.microsoft.com/en-us/dotnet/api/system.directoryservices.protocols.ldapsessionoptions.verifyservercertificate?view=net-8.0 which only works on Windows.
I'm not aware of any similar support in other DirectoryServices API but @BRDPM @grubioe @jay98014 may know more as the System.DirectoryServices.AccountManagement owners.
@ericstj Yes, I'm running this on Windows. I've looked at modifying my process to use LdapConnection so I could take advantage of the callback you reference, and that is an option, just not the preferred one.
bumping this up a bit. I'm curious of other thoughts on this.
Any reason to not add the same callback functionality to PrincipalContext
Problem
I have an application that is running on a server where I don’t have the ability to add certificates to the computer store. This application is performing various actions against Active Directory including searching and updating of properties using
PrincipalContext
andDirectoryEntry
. Active Directory performs certificate renewal based on the internal CA root certificate. The server I'm running from is not a domain member, and it cannot be joined to the domain.I can’t find where
PrincipalContext
andDirectoryEntry
have any options for trusting certificates not in the computer store.Question
Is there any way to add a self-signed root certificate to a runtime store that
PrincipalContext
andDirectoryEntry
will honor? I knowLdapConnection
has a callback option that can be used for this, but it doesn't seem to be available toPrincipalContext
orDirectoryEntry
Sample Code
returns the following error: