我一直在谷歌寻找一个严肃的解决方案,我只得到"Regisrty解决方案"的东西,我不认为甚至与我的问题有关.
由于某种原因,我得到这个错误,而我只启动一次TcpListner,当+如果失败我停止服务器.我真的不明白.这是我的代码:
class Program
{
private static string ServerName = "";
private static string UserName = "";
private static string Password = "";
private static string dbConnectionSring = "";
private static X509Certificate adminCertificate;
private static byte[] readBuffer = new byte[4096];
static void Main(string[] args)
{
Console.WriteLine("Please grant SQL Server access to the Admin Server:\n");
Console.Write("Server Name: ");
ServerName = Console.ReadLine();
Console.Write("\nUser Name: ");
UserName = Console.ReadLine();
Console.Write("\nPassword: ");
Password = PasswordMasker.Mask(Password);
dbConnectionSring = SQLServerAccess.CreateConnection(ServerName, UserName, Password);
adminCertificate = Certificate.GenerateOrImportCertificate("AdminCert.pfx", "randomPassword"); …Run Code Online (Sandbox Code Playgroud) 我正在阅读msdn info articels很长一段时间,但我仍然无法理解它.
基于不需要客户端身份验证的假设:
1.当我打电话时SslStream.AuthenticateAsServer(...),我在服务器端或客户端调用此方法吗?
2.建立SslStream时,只有服务器负责建立SslStream服务器和客户端?
3.如果它只是服务器的责任,是否意味着客户端可以只使用常规send()和recieve()操作而无需自己创建SslStream?
4.客户端是否需要获取证书文件才能验证服务器?
非常感谢你提前,我真的找不到关于这个主题的很多信息,我一直在寻找这个信息很长一段时间..