protected override void PreRun(TestContext ctx) { base.PreRun(ctx); store = BtlsProvider.CreateNativeStore(); if (Parameters.AddTrustedRoots) { store.AddTrustedRoots(); } AddTrustedRoots(ctx); chain = BtlsProvider.CreateNativeChain(); SetupChain(ctx); storeCtx = BtlsProvider.CreateNativeStoreCtx(); storeCtx.Initialize(store, chain); verifyParam = SetupVerifyParameters(ctx); if (Parameters.CheckTime != null) { verifyParam.SetTime(Parameters.CheckTime.Value); } if (Parameters.Host != null) { verifyParam.SetHost(Parameters.Host); } if (verifyParam != null) { storeCtx.SetVerifyParam(verifyParam); } }
public Task Initialize(TestContext ctx, CancellationToken cancellationToken) { return(Task.Run(() => { store = BtlsProvider.CreateNativeStore(); if (loadTrustedRoots) { store.AddTrustedRoots(); } })); }
public Task Destroy(TestContext ctx, CancellationToken cancellationToken) { return(Task.Run(() => { if (store != null) { store.Dispose(); store = null; } })); }
protected override void PostRun(TestContext ctx) { if (verifyParam != null) { verifyParam.Dispose(); verifyParam = null; } if (storeCtx != null) { storeCtx.Dispose(); storeCtx = null; } if (chain != null) { chain.Dispose(); chain = null; } if (store != null) { store.Dispose(); store = null; } base.PostRun(ctx); }