使用SSL连接时win表单应用程序和类库应用程序有什么区别

发布于 2025-01-05 17:14:06 字数 808 浏览 1 评论 0原文

我有一个类库应用程序,我尝试在其中使用 SSL 连接。 但是当我尝试以客户端身份验证到服务器时,我收到以下错误消息:

 ssl.AuthenticateAsClient("TargetHost");

“无法在 DLL 'security.dll' 中找到名为 'EnumerateSecurityPackagesW' 的入口点。”

我已经在 Windows 应用程序中完成了这个场景,并且效果很好。 有这方面的身体经验吗?

            SslStream ssl = null;
            TcpClient client = new TcpClient();
            client.Connect("127.0.0.1", 9988);

            NetworkStream _NetworkStream = client.GetStream();

            IPAddress ipAdd = IPAddress.Parse("127.0.0.1");
            IPEndPoint remoteEP = new IPEndPoint(ipAdd, 9988);

            ssl = new SslStream(_NetworkStream,
                  false,new  RemoteCertificateValidationCallback(CertificateValidationCallback));

                ssl.AuthenticateAsClient("TargetHost");

I have a Class library application in which I'm trying to use SSL connection.
but when i tried to get Authenticate As a Client to server i got the following error message:

 ssl.AuthenticateAsClient("TargetHost");

"Unable to find an entry point named 'EnumerateSecurityPackagesW' in DLL 'security.dll'."

i have done this scenario in windows application and it works fine.
have any body experience about this?

            SslStream ssl = null;
            TcpClient client = new TcpClient();
            client.Connect("127.0.0.1", 9988);

            NetworkStream _NetworkStream = client.GetStream();

            IPAddress ipAdd = IPAddress.Parse("127.0.0.1");
            IPEndPoint remoteEP = new IPEndPoint(ipAdd, 9988);

            ssl = new SslStream(_NetworkStream,
                  false,new  RemoteCertificateValidationCallback(CertificateValidationCallback));

                ssl.AuthenticateAsClient("TargetHost");

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

赏烟花じ飞满天 2025-01-12 17:14:06

您能否检查 security.dll 库文件是否可供使用您的类库的应用程序使用?

您的第一个应用程序似乎需要这个本机库。检查它是否包含在应用程序可执行文件中。

第二个应用程序引用您的自定义类库,该类库显然无法加载 security.dll 本机 dll

"Unable to find an entry point named 'EnumerateSecurityPackagesW' in DLL 'security.dll'."

您应该比较包含两个应用程序的目录,并且可能在第二个应用程序中包含缺少的 dll。

Could you check that the security.dll library file is available to the application using your class library?

Your first app seems to require this native library. Check if it's included along the application executable.

The second app references your custom class library, which apparently cannot load the security.dll native dll

"Unable to find an entry point named 'EnumerateSecurityPackagesW' in DLL 'security.dll'."

You should compare the directory containing the two apps, and maybe include in the second app the absent dll.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文