File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 11using System ;
2+ using System . Diagnostics ;
23using System . IO ;
34using Semmle . Util ;
5+ using Semmle . Util . Logging ;
46
57namespace Semmle . Extraction . CSharp . DependencyFetching
68{
@@ -49,5 +51,17 @@ internal DependabotProxy(TemporaryDirectory tempWorkingDirectory)
4951 using var writer = this . certFile . CreateText ( ) ;
5052 writer . Write ( cert ) ;
5153 }
54+
55+ internal void ApplyProxy ( ILogger logger , ProcessStartInfo startInfo )
56+ {
57+ // If the proxy isn't configured, we have nothing to do.
58+ if ( ! this . IsConfigured ) return ;
59+
60+ logger . LogInfo ( $ "Setting up Dependabot proxy at { this . Address } ") ;
61+
62+ startInfo . EnvironmentVariables [ "HTTP_PROXY" ] = this . Address ;
63+ startInfo . EnvironmentVariables [ "HTTPS_PROXY" ] = this . Address ;
64+ startInfo . EnvironmentVariables [ "SSL_CERT_FILE" ] = this . certFile ? . FullName ;
65+ }
5266 }
5367}
You can’t perform that action at this time.
0 commit comments