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 1
1
using System ;
2
+ using System . Diagnostics ;
2
3
using System . IO ;
3
4
using Semmle . Util ;
5
+ using Semmle . Util . Logging ;
4
6
5
7
namespace Semmle . Extraction . CSharp . DependencyFetching
6
8
{
@@ -49,5 +51,17 @@ internal DependabotProxy(TemporaryDirectory tempWorkingDirectory)
49
51
using var writer = this . certFile . CreateText ( ) ;
50
52
writer . Write ( cert ) ;
51
53
}
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
+ }
52
66
}
53
67
}
You can’t perform that action at this time.
0 commit comments