Exemple #1
0
 protected override void Stop()
 {
     if (openssl != null)
     {
         openssl.Dispose();
         openssl = null;
     }
 }
Exemple #2
0
        public sealed override Task Start(TestContext ctx, CancellationToken cancellationToken)
        {
            var protocol = GetProtocolVersion();

            ctx.LogMessage("Starting {0} version {1}.", this, protocol);
            openssl = new NativeOpenSsl(IsServer, Parameters.EnableDebugging, protocol);
            var validationCallback = GetValidationCallback();

            openssl.SetCertificateVerify(NativeOpenSsl.VerifyMode.SSL_VERIFY_PEER, validationCallback);
            InitDiffieHellman(protocol);
            Initialize();

            Task.Factory.StartNew(() => {
                try {
                    CreateConnection(ctx);
                    createTcs.SetResult(null);
                } catch (Exception ex) {
                    createTcs.SetException(ex);
                }
            });
            return(FinishedTask);
        }
		protected override void Stop ()
		{
			if (openssl != null) {
				openssl.Dispose ();
				openssl = null;
			}
		}
		public sealed override Task Start (TestContext ctx, CancellationToken cancellationToken)
		{
			var protocol = GetProtocolVersion ();
			ctx.LogMessage ("Starting {0} version {1}.", this, protocol);
			openssl = new NativeOpenSsl (IsServer, false, protocol);
			var validationCallback = GetValidationCallback ();
			openssl.SetCertificateVerify (NativeOpenSsl.VerifyMode.SSL_VERIFY_PEER, validationCallback);
			Initialize ();

			Task.Factory.StartNew (() => {
				try {
					CreateConnection ();
					createTcs.SetResult (null);
				} catch (Exception ex) {
					createTcs.SetException (ex);
				}
			});
			return FinishedTask;
		}