On my dev machine, I had to install AD-LDS. In principle, it works fine, but the first one connects to AD-LDS through the PrincipalContext class very slowly (30 seconds +). It seems to me that he first tries to connect to some non-existent host or directory, and then after a timeout (30 seconds) connects to my AD-LDS and does what it should do.
The same behavior is observed when connecting with LDP.exe and SSL. However, using ADSI-Edit, SSL connectivity is very fast. Thus, it connects via SSL. I looked to see if I could see something in the violinist, but there was nothing. Also in the event log I can not find anything. Maybe this has something to do with certificate search? This is self-recording with makecert.
Update
In the meantime, I noticed one little thing that might give a hint: the following message appears in the system event log when you first establish an SSL connection with AD-LDS:
Name resolution for the name _ldap._tcp. [ machineName ] is disabled after none of the configured DNS servers respond
However, the message is logged only once, but each connection to the server takes 30 seconds +. I also tried to enter the appropriate entries in the hosts file, but nothing changed.
Additional Information
This is probably not a certificate issue, but it may help solve the problem. Therefore, here, as I created the certificates (more or less freight code):
Rootoothority
makecert -pe -n "CN=MyDevRootAuthority" -ss my -sr LocalMachine -a sha1 -sky signature -r "MyDevRootAuthority.cer"
Server certificate
makecert -pe -n "CN=[MyComputerName]" -ss my -sr LocalMachine -a sha1 -sky exchange -eku 1.3.6.1.5.5.7.3.1 -in "MyDevRootAuthority" -is MY -ir LocalMachine -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12 "MyTestCertificate.cer"
After creation, I transferred root authority to trusted authorities and granted the required permissions.