Commit bf55a4ad bf55a4addff775f64ac40c740b746171a6589d4a by Christian Gerdes

Fixed a bug when parsing PEM files in Client Certificate plugin

1 parent 75ee06ae
......@@ -784,9 +784,8 @@ namespace LIL_VSTT_Plugins
Org.BouncyCastle.Crypto.AsymmetricCipherKeyPair bcKey = null;
Org.BouncyCastle.X509.X509Certificate bcCert = null;
while (keyTextBeginPos != -1)
while (keyTextBeginPos != -1 && keyTextEndPos != -1)
{
text = text.Substring(keyTextBeginPos);
object obj;
try
{
......@@ -818,6 +817,8 @@ namespace LIL_VSTT_Plugins
}
}
keyTextBeginPos = text.IndexOf("-----BEGIN", keyTextEndPos);
if(keyTextBeginPos >= 0) text = text.Substring(keyTextBeginPos);
keyTextEndPos = text.IndexOf("-----END");
}
if (bcCert == null)
{
......
......@@ -86,6 +86,9 @@
<None Include="LoadTest4.loadtest">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="WebTest2.webtest">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="WebTest22.webtest">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
......
<?xml version="1.0" encoding="utf-8"?>
<WebTest Name="WebTest2" Id="97416298-3dc2-4f16-a28f-75470ee03ec8" Owner="" Priority="2147483647" Enabled="True" CssProjectStructure="" CssIteration="" Timeout="0" WorkItemIds="" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010" Description="" CredentialUserName="" CredentialPassword="" PreAuthenticate="True" Proxy="default" StopOnError="False" RecordedResultFile="" ResultsLocale="">
<Items>
<Request Method="GET" Guid="b9a8ca3a-ceb3-4531-b567-9ee2dbd79c10" Version="1.1" Url="https://ort-api-20.test.minpension.se/medborgare/197503140555" ThinkTime="0" Timeout="300" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="0" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False" />
</Items>
<WebTestPlugins>
<WebTestPlugin Classname="LIL_VSTT_Plugins.ClientCertificatePlugin, LIL_VSTT_Plugins, Version=1.3.0.0, Culture=neutral, PublicKeyToken=null" DisplayName="Client Certificate" Description="(C) Copyright 2016 LIGHTS IN LINE AB&#xD;&#xA;Sätter webtestet att använda ett specifikt client cert för SSL. Certifikatet installeras automatiskt i Windows User Certificate Store.">
<RuleParameters>
<RuleParameter Name="pCertificatePath" Value="C:\Temp\lightsinline_cert_key.pem" />
<RuleParameter Name="pCertificatePathParameter" Value="" />
<RuleParameter Name="pCertificatePassword" Value="" />
<RuleParameter Name="pCertificatePasswordParameter" Value="" />
<RuleParameter Name="pDebug" Value="False" />
<RuleParameter Name="pInstallTrusted" Value="True" />
<RuleParameter Name="pInstallUntrusted" Value="True" />
</RuleParameters>
</WebTestPlugin>
</WebTestPlugins>
</WebTest>
\ No newline at end of file