Merge pull request #950 from jtattermusch/csharp_cloud_to_prod

C# interop client support for external CA file
pull/901/head
Michael Lumish 10 years ago
commit 9cf9fcaf53
  1. 12
      src/csharp/Grpc.IntegrationTesting/InteropClient.cs

@ -103,8 +103,16 @@ namespace Grpc.IntegrationTesting
Credentials credentials = null;
if (options.useTls)
{
// TODO: use also Env variable for location of the ca file.
credentials = new SslCredentials(File.ReadAllText("data/ca.pem"));
string caPath = "data/ca.pem"; // Default testing CA
if (!options.useTestCa)
{
caPath = Environment.GetEnvironmentVariable("SSL_CERT_FILE");
if (string.IsNullOrEmpty(caPath))
{
throw new ArgumentException("CA path environment variable is not set.");
}
}
credentials = new SslCredentials(File.ReadAllText(caPath));
}
ChannelArgs channelArgs = null;

Loading…
Cancel
Save