Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Products
/
VSTT-Plugins
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Issues
2
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
1eac38b7
...
1eac38b7b0c95f7362068eb19bfb348934771bea
authored
2018-04-19 18:36:53 +0200
by
Christian Gerdes
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
First beta of Clear SSL Sessions plugin for loadtest
1 parent
96bbe62e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
LIL_VSTT_Plugins/LoadTestPlugins.cs
LIL_VSTT_Plugins/LoadTestPlugins.cs
View file @
1eac38b
...
...
@@ -21,6 +21,43 @@ using System.Net;
namespace
LIL_VSTT_Plugins
{
/// <summary>
/// LoadTest Context Copy
/// </summary>
[
DisplayName
(
"Clear SSL Sessions"
)]
[
Description
(
"(C) Copyright 2018 LIGHTS IN LINE AB\r\nClears all SSL Sessions after each test from the SSLClients. Beta."
)]
public
class
ClearSSLSessions
:
ILoadTestPlugin
{
LoadTest
mLoadTest
;
public
void
Initialize
(
LoadTest
loadTest
)
{
mLoadTest
=
loadTest
;
mLoadTest
.
TestStarting
+=
new
EventHandler
<
TestStartingEventArgs
>(
mLoadTest_TestStarting
);
mLoadTest
.
TestFinished
+=
new
EventHandler
<
TestFinishedEventArgs
>(
mLoadTest_TestFinished
);
mLoadTest
.
TestSelected
+=
new
EventHandler
<
TestSelectedEventArgs
>(
mLoadTest_TestSelected
);
}
void
mLoadTest_TestStarting
(
object
sender
,
TestStartingEventArgs
e
)
{
clearIt
();
}
void
mLoadTest_TestFinished
(
object
sender
,
TestFinishedEventArgs
e
)
{
clearIt
();
}
void
mLoadTest_TestSelected
(
object
sender
,
TestSelectedEventArgs
e
)
{
clearIt
();
}
void
clearIt
()
{
System
.
Reflection
.
Assembly
asm
=
System
.
Reflection
.
Assembly
.
GetAssembly
(
typeof
(
System
.
Net
.
Security
.
SslStream
));
Type
t
=
asm
.
GetType
(
"System.Net.Security.SslSessionsCache"
);
System
.
Reflection
.
FieldInfo
f
=
t
.
GetField
(
"s_CachedCreds"
,
System
.
Reflection
.
BindingFlags
.
NonPublic
|
System
.
Reflection
.
BindingFlags
.
Static
);
System
.
Collections
.
Hashtable
h
=
(
System
.
Collections
.
Hashtable
)
f
.
GetValue
(
null
);
h
.
Clear
();
}
}
/// <summary>
/// LoadTest Context Copy
...
...
Please
register
or
sign in
to post a comment