Skip to content

Commit 85fa1b3

Browse files
committed
Make sure https dev cert is trusted
1 parent 33df7b4 commit 85fa1b3

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/ILLink.Tasks.IntegrationTests/WebApiTest.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ public string SetupProject ()
3636
Assert.True (false);
3737
}
3838

39+
EnsureTrustHttpsDevCert (projectRoot);
40+
3941
PreventPublishFiltering (csproj);
4042

4143
AddLinkerReference (csproj);
@@ -64,6 +66,19 @@ private void PreventPublishFiltering (string csproj)
6466
xdoc.Save (fs);
6567
}
6668
}
69+
70+
private void EnsureTrustHttpsDevCert (string projectRoot)
71+
{
72+
// Web API templates use https auth so we need the dev cert to be trusted
73+
int ret = CommandHelper.Dotnet ("dev-certs https --check", projectRoot);
74+
if (ret != 0) {
75+
ret = CommandHelper.Dotnet ("dev-certs https --trust", projectRoot);
76+
if (ret != 0) {
77+
LogMessage ("dotnet dev-certs https --trust failed");
78+
Assert.True (false);
79+
}
80+
}
81+
}
6782
}
6883

6984
public class WebApiTest : IntegrationTestBase, IClassFixture<WebApiFixture>

0 commit comments

Comments
 (0)