diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f33f8aa..8c4a2f8 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -31,6 +31,12 @@ jobs: apt install --yes --no-install-recommends ca-certificates apt install --yes --no-install-recommends dotnet8 + + # Trust ASP.NET Core HTTPS development certificate so that GRPC server can be contacted through HTTPS. + # HTTPS connection is used in end-to-end GRPC tests. + dotnet dev-certs https + sudo -E dotnet dev-certs https -ep /usr/local/share/ca-certificates/aspnet/https.crt --format PEM + sudo update-ca-certificates - name: Restore nuget dependencies run: dotnet restore diff --git a/src/FX.GrpcClient/Instance.cs b/src/FX.GrpcClient/Instance.cs index 9e34af4..d49bec9 100644 --- a/src/FX.GrpcClient/Instance.cs +++ b/src/FX.GrpcClient/Instance.cs @@ -18,7 +18,7 @@ public class Instance public FXGrpcService.FXGrpcServiceClient Connect() { - var channel = GrpcChannel.ForAddress($"http://{serverFqdn}:{Port}"); + var channel = GrpcChannel.ForAddress($"https://{serverFqdn}:{HttpsPort}"); var client = new FXGrpcService.FXGrpcServiceClient(channel); return client; } diff --git a/src/FX.Tests/E2ETests.cs b/src/FX.Tests/E2ETests.cs index e825ae2..0a25042 100644 --- a/src/FX.Tests/E2ETests.cs +++ b/src/FX.Tests/E2ETests.cs @@ -19,7 +19,7 @@ private Process LaunchGrpcServer() var solutionDir = (new DirectoryInfo(Environment.CurrentDirectory)).Parent?.Parent?.Parent?.Parent?.Parent; var serviceExeDir = Path.Join(solutionDir.FullName, "src", "FX.GrpcService", "bin", "Debug", "net8.0"); - var argsString = $"--urls http://localhost:{GrpcClient.Instance.Port}"; + var argsString = $"--urls https://localhost:{GrpcClient.Instance.HttpsPort}"; if (OperatingSystem.IsWindows()) {