private static void runSSLServer() { SslServer sslServer = new SslServer(new X509Certificate(CertificatesAndCAs.device), new X509Certificate[] { }, SslVerification.NoVerification, new SslProtocols[] { SslProtocols.Default }, false); while (true) { try { sslServer.RunServer(); } catch (Exception ex) { Debug.Print(ex.Message); // throw; } } }
public MFTestResults VerifyServerConnectionCombinations() { //Create the SslTable SslTestTable sslTestTable = new SslTestTable(tmc.desktopIPAddress); MFTestResults overAllTestResult = MFTestResults.Pass; for (int i = 0; i < sslTestTable.sslServer.Length; i++) { MFTestResults testResult = MFTestResults.Pass; //This call is what launches the remote test case on the desktop. Log.Comment("Running Test Scenario number: " + i); if (tmc.RunTest("VerifyClientConnectionCombinations", i) == MFTestResults.Fail) { return(MFTestResults.Fail); } SslServer sslServer = sslTestTable.sslServer[i]; if (sslServer.RunServer() == MFTestResults.Fail) { testResult = MFTestResults.Fail; } //This call gets the result from the remote test case. Also fails if the test previously failed somewhere prior to this. if (tmc.GetTestResult() == MFTestResults.Fail) { testResult = MFTestResults.Fail; } if (testResult == MFTestResults.Pass) { Log.Comment("VerifyConnectionCombinations iteration number: " + i + " Passed."); } else { Log.Comment("VerifyConnectionCombinations iteration number: " + i + " Failed."); overAllTestResult = MFTestResults.Fail; } } //if we get here we've passed all the tests successfully. return(overAllTestResult); }
public MFTestResults TestMethod1() { MFTestResults testResult = MFTestResults.Fail; Log.Comment("Create the client and server sockets"); SslServer sslServer = new SslServer(); SslClient sslClient = new SslClient(); try { // Set up the server here Log.Comment("Create server thread"); sslServer.RunServer(); // Set up the client here sslClient.serverEp = sslServer.serverEp; sslClient.RunClient(); if (sslClient.messageSent == sslClient.messageReceived) { testResult = MFTestResults.Pass; } } catch (Exception e) { Log.Comment("Incorrect Exception caught: " + e.ToString()); } finally { try { sslServer.Close(); sslClient.Close(); } catch { } } Log.Comment("known issue: 20848 SSL tests don't work with loopback"); return(testResult == MFTestResults.Fail ? MFTestResults.KnownFailure : testResult); }
private static bool TestMethod1() { // MFTestResults testResult = MFTestResults.Fail; bool testResult = false; Debug.Print("Create the client and server sockets"); SslServer sslServer = new SslServer(); SslClient sslClient = new SslClient(); try { // Set up the server here Debug.Print("Create server thread"); sslServer.RunServer(); // Set up the client here sslClient.serverEp = sslServer.serverEp; sslClient.RunClient(); if (sslClient.messageSent == sslClient.messageReceived) { testResult = true; } } catch (Exception e) { Debug.Print("Incorrect Exception caught: " + e.ToString()); } finally { try { sslServer.Close(); sslClient.Close(); } catch { } } return(testResult); }
public MFTestResults TestMethod1() { MFTestResults testResult = MFTestResults.Fail; Log.Comment("Create the client and server sockets"); SslServer sslServer = new SslServer(); SslClient sslClient = new SslClient(); try { // Set up the server here Log.Comment("Create server thread"); sslServer.RunServer(); // Set up the client here sslClient.serverEp = sslServer.serverEp; sslClient.RunClient(); if( sslClient.messageSent == sslClient.messageReceived ) testResult = MFTestResults.Pass; } catch (Exception e) { Log.Comment("Incorrect Exception caught: " + e.ToString()); } finally { try { sslServer.Close(); sslClient.Close(); } catch { } } Log.Comment("known issue: 20848 SSL tests don't work with loopback"); return (testResult == MFTestResults.Fail ? MFTestResults.KnownFailure : testResult); }