Пример #1
0
			public void BasicServerTest() {
				try {
					testName = "BasicServerTest";
					AcceptConnection(); // sets the client member
					sslStream = new SslStream(client.GetStream(), false);
					sslStream.AuthenticateAsServer(testServer.serverCertificate);
					// Do the server read, and write of the messages
					if (DoServerReadWrite()) {
						Shutdown(true);
					}
					else {
						Shutdown(false);
					}
				}
				catch (Exception) {
					Shutdown(false);
				}
			}
Пример #2
0
			public void BasicClientTest() {
				try {
					testName = "BasicClientTest";
					client = new TcpClient("localhost", 8443);
					sslStream = new SslStream(client.GetStream(), false);
					sslStream.AuthenticateAsClient("localhost");

					if (DoClientReadWrite()) {
						Shutdown(true);
					}
					else {
						Shutdown(false);
					}
				}
				catch (Exception) {
					Shutdown(false);
				}
			}