Skip to content
Snippets Groups Projects
Commit f7e32a66 authored by Jan Tattermusch's avatar Jan Tattermusch
Browse files

C# interop client support for external CA file

parent 0431246c
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment