Fix dev cert setup for websocket test
This commit is contained in:
Родитель
9df9984d24
Коммит
aeb02e60c1
|
@ -85,12 +85,13 @@ namespace Test.Amqp
|
|||
string testName = "WebSocketSslMutalAuthTest";
|
||||
Address listenAddress = new Address("wss://localhost:18081/" + testName + "/");
|
||||
|
||||
X509Certificate2 cert = Test.Common.Extensions.GetCertificate("localhost");
|
||||
|
||||
string output;
|
||||
int code = Exec("netsh.exe", string.Format("http show sslcert hostnameport={0}:{1}", listenAddress.Host, listenAddress.Port), out output);
|
||||
if (code != 0)
|
||||
{
|
||||
X509Certificate2 cert = null;
|
||||
Test.Common.Extensions.TryGetCertificate(StoreLocation.LocalMachine, StoreName.My, "localhost", out cert);
|
||||
Assert.IsTrue(cert != null, "Failed to get dev-cert from LocalMachine store");
|
||||
string args = string.Format("http add sslcert hostnameport={0}:{1} certhash={2} certstorename=MY appid={{{3}}} clientcertnegotiation=enable",
|
||||
listenAddress.Host, listenAddress.Port, cert.Thumbprint, Guid.NewGuid());
|
||||
code = Exec("netsh.exe", args, out output);
|
||||
|
|
Загрузка…
Ссылка в новой задаче