Skip to content

Commit

Permalink
CI,GrpcClient,Tests: use HTTPS connection
Browse files Browse the repository at this point in the history
Use HTTPS connection for GRPC communtication.
  • Loading branch information
webwarrior-ws committed Feb 8, 2024
1 parent 6f14aff commit 2e29c02
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ 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
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
Expand Down
2 changes: 1 addition & 1 deletion src/FX.GrpcClient/Instance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class Instance

public FXGrpcService.FXGrpcServiceClient Connect()
{
var channel = GrpcChannel.ForAddress($"http://{serverFqdn}:{Port}");
var channel = GrpcChannel.ForAddress($"https://{serverFqdn}:{Port}");
var client = new FXGrpcService.FXGrpcServiceClient(channel);
return client;
}
Expand Down
2 changes: 1 addition & 1 deletion src/FX.Tests/E2ETests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,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.Port}";

if (OperatingSystem.IsWindows())
{
Expand Down

0 comments on commit 2e29c02

Please sign in to comment.