mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
Pass Http proxy URL and strict SSL flag to backend STS (#24550)
This commit is contained in:
@@ -33,6 +33,8 @@ export const configObjectExplorerGroupBySchemaFlagName = 'mssql.objectExplorer.g
|
||||
export const configAsyncParallelProcessingName = 'mssql.parallelMessageProcessing';
|
||||
export const configEnableSqlAuthenticationProviderName = 'mssql.enableSqlAuthenticationProvider';
|
||||
export const configEnableConnectionPoolingName = 'mssql.enableConnectionPooling';
|
||||
export const configHttpProxy = 'http.proxy';
|
||||
export const configHttpProxyStrictSSL = 'http.proxyStrictSSL';
|
||||
|
||||
// COMMANDNAMES //////////////////////////////////////////////////////////
|
||||
export const cmdObjectExplorerEnableGroupBySchemaCommand = 'mssql.enableGroupBySchema';
|
||||
|
||||
@@ -153,6 +153,10 @@ export async function activate(context: vscode.ExtensionContext): Promise<IExten
|
||||
}
|
||||
await displayReloadAds();
|
||||
}
|
||||
// Prompt to reload ADS as we send the proxy URL to STS to instantiate Http Client instances.
|
||||
if (e.affectsConfiguration(Constants.configHttpProxy) || e.affectsConfiguration(Constants.configHttpProxyStrictSSL)) {
|
||||
await displayReloadAds();
|
||||
}
|
||||
}));
|
||||
|
||||
registerTableDesignerCommands(appContext);
|
||||
|
||||
@@ -22,6 +22,9 @@ const parallelMessageProcessingConfig = 'parallelMessageProcessing';
|
||||
const enableSqlAuthenticationProviderConfig = 'enableSqlAuthenticationProvider';
|
||||
const enableConnectionPoolingConfig = 'enableConnectionPooling';
|
||||
const tableDesignerPreloadConfig = 'tableDesigner.preloadDatabaseModel';
|
||||
const httpConfig = 'http';
|
||||
const configProxy = 'proxy';
|
||||
const configProxyStrictSSL = 'proxyStrictSSL';
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -85,6 +88,19 @@ export function getConfigLogRetentionSeconds(): number | undefined {
|
||||
}
|
||||
}
|
||||
|
||||
export function getHttpProxyUrl(): string | undefined {
|
||||
let config = getConfiguration(httpConfig);
|
||||
if (config) {
|
||||
return config[configProxy];
|
||||
} return undefined;
|
||||
}
|
||||
|
||||
export function getHttpProxyStrictSSL(): boolean {
|
||||
let config = getConfiguration(httpConfig);
|
||||
if (config) {
|
||||
return config.get<boolean>(configProxyStrictSSL, true); // true by default
|
||||
} return true; // true by default.
|
||||
}
|
||||
/**
|
||||
* The tracing level defined in the package.json
|
||||
*/
|
||||
@@ -202,6 +218,15 @@ export function getCommonLaunchArgsAndCleanupOldLogFiles(logPath: string, fileNa
|
||||
}
|
||||
// Always enable autoflush so that log entries are written immediately to disk, otherwise we can end up with partial logs
|
||||
launchArgs.push('--autoflush-log');
|
||||
|
||||
let httpProxy = getHttpProxyUrl();
|
||||
if (httpProxy) {
|
||||
launchArgs.push('--http-proxy-url');
|
||||
launchArgs.push(httpProxy);
|
||||
if (getHttpProxyStrictSSL()) {
|
||||
launchArgs.push('--http-proxy-strict-ssl')
|
||||
}
|
||||
}
|
||||
return launchArgs;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user