private static void SetSslOptionsForCertificateStore(EasyRequest easy) { // Support specifying certificate directory/bundle via environment variables: SSL_CERT_DIR, SSL_CERT_FILE. GetSslCaLocations(out string sslCaPath, out string sslCaInfo); if (sslCaPath != string.Empty) { easy.SetCurlOption(Interop.Http.CURLoption.CURLOPT_CAPATH, sslCaPath); // https proxy support requires libcurl 7.52.0+ easy.TrySetCurlOption(Interop.Http.CURLoption.CURLOPT_PROXY_CAPATH, sslCaPath); } if (sslCaInfo != string.Empty) { easy.SetCurlOption(Interop.Http.CURLoption.CURLOPT_CAINFO, sslCaInfo); // https proxy support requires libcurl 7.52.0+ easy.TrySetCurlOption(Interop.Http.CURLoption.CURLOPT_PROXY_CAINFO, sslCaInfo); } }
private static void SetSslOptionsForCertificateStore(EasyRequest easy) { // Support specifying certificate directory/bundle via environment variables: SSL_CERT_DIR, SSL_CERT_FILE. string sslCertDir = Environment.GetEnvironmentVariable("SSL_CERT_DIR"); if (sslCertDir != null) { easy.SetCurlOption(Interop.Http.CURLoption.CURLOPT_CAPATH, sslCertDir); // https proxy support requires libcurl 7.52.0+ easy.TrySetCurlOption(Interop.Http.CURLoption.CURLOPT_PROXY_CAPATH, sslCertDir); } string sslCertFile = Environment.GetEnvironmentVariable("SSL_CERT_FILE"); if (sslCertFile != null) { easy.SetCurlOption(Interop.Http.CURLoption.CURLOPT_CAINFO, sslCertFile); // https proxy support requires libcurl 7.52.0+ easy.TrySetCurlOption(Interop.Http.CURLoption.CURLOPT_PROXY_CAINFO, sslCertFile); } }