使用SSL连接时win表单应用程序和类库应用程序有什么区别
我有一个类库应用程序,我尝试在其中使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您能否检查 security.dll 库文件是否可供使用您的类库的应用程序使用?
您的第一个应用程序似乎需要这个本机库。检查它是否包含在应用程序可执行文件中。
第二个应用程序引用您的自定义类库,该类库显然无法加载 security.dll 本机 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
You should compare the directory containing the two apps, and maybe include in the second app the absent dll.