-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CA1416 incorrectly warning on LdapSessionOptions.SecureSocketLayer on Linux #62462
Comments
Tagging subscribers to this area: @dotnet/area-system-directoryservices, @jay98014 Issue DetailsDescriptionCA1416 is being raised by the analyzer when accessing the There are no attributes on the Reproduction Stepsdotnet new console
dotnet package add System.DirectoryServices.Protocols // Program.cs
using System.DirectoryServices.Protocols;
using System.Net;
var ldapIdentifier = new LdapDirectoryIdentifier("localhost", 636);
var ldapConnection = new LdapConnection(ldapIdentifier, new NetworkCredential("CN=admin,DC=example,DC=com", "password"))
{
AuthType = AuthType.Basic
};
ldapConnection.SessionOptions.SecureSocketLayer = true; Expected behaviorWarning should not show because setting Actual behaviorCA1416 is thrown:
Regression?No response Known Workarounds#pragma warning disable CA1416
ldapConnection.SessionOptions.SecureSocketLayer = true;
#pragma warning enable CA1416 Configuration.NET Version: 6.0 Other informationNo response
|
Closing as fixed. |
Description
CA1416 is being raised by the analyzer when accessing the
LdapSessionOptions.SecureSocketLayer
property on Linux, with a message saying that it is only supported on Windows. The code is supported, however, and it executes just fine.There are no attributes on the
SecureSocketLayer
property in the .NET 6.0 source code that I can see that would be causing this warning to be raised.Reproduction Steps
Expected behavior
Warning should not show because setting
LdapSessionOptions.SecureSocketLayer
is supported on Linux.Actual behavior
CA1416 is thrown:
Regression?
No response
Known Workarounds
Configuration
.NET Version: 6.0
OS: Ubuntu Linux 20.04
Architecture: x64
IDE: VS Code, C# Extension version 1.23.17
Other information
No response
The text was updated successfully, but these errors were encountered: