test kerberos import
parent
d8d0ddba9c
commit
5cf2c74197
|
@ -38,6 +38,9 @@ export function connectProxyResolver(
|
|||
initData: IExtensionHostInitData,
|
||||
disposables: DisposableStore,
|
||||
) {
|
||||
if (extHostLogService.getLevel() === LogServiceLevel.Trace) {
|
||||
testKerberosImport(extHostLogService);
|
||||
}
|
||||
|
||||
const useHostProxy = initData.environment.useHostProxy;
|
||||
const doUseHostProxy = typeof useHostProxy === 'boolean' ? useHostProxy : !initData.remote.isRemote;
|
||||
|
@ -96,6 +99,27 @@ export function connectProxyResolver(
|
|||
return configureModuleLoading(extensionService, lookup);
|
||||
}
|
||||
|
||||
function testKerberosImport(extHostLogService: ILogService) {
|
||||
(async () => {
|
||||
try {
|
||||
const importKerberos = await import('kerberos');
|
||||
const importType = typeof importKerberos;
|
||||
extHostLogService.trace('ProxyResolver#testKerberosImport Kerberos import type', importType);
|
||||
if (importKerberos && importType === 'object') {
|
||||
const importDefault = importKerberos.default;
|
||||
const importDefaultType = typeof importDefault;
|
||||
extHostLogService.trace('ProxyResolver#testKerberosImport Kerberos import.default type', importDefaultType);
|
||||
if (importDefault && importDefaultType === 'object') {
|
||||
extHostLogService.trace('ProxyResolver#testKerberosImport Kerberos import.default.initializeClient type', typeof importDefault.initializeClient);
|
||||
}
|
||||
extHostLogService.trace('ProxyResolver#testKerberosImport Kerberos import.initializeClient type', typeof importKerberos.initializeClient);
|
||||
}
|
||||
} catch (err) {
|
||||
extHostLogService.trace('ProxyResolver#testKerberosImport Kerberos import failed', err);
|
||||
}
|
||||
})();
|
||||
}
|
||||
|
||||
const unsafeHeaders = [
|
||||
'content-length',
|
||||
'host',
|
||||
|
@ -480,7 +504,8 @@ async function lookupProxyAuthorization(
|
|||
state.kerberosRequested = true;
|
||||
|
||||
try {
|
||||
const kerberos = await import('kerberos');
|
||||
const importKerberos = await import('kerberos');
|
||||
const kerberos = importKerberos.default || importKerberos;
|
||||
const url = new URL(proxyURL);
|
||||
const spn = configProvider.getConfiguration('http').get<string>('proxyKerberosServicePrincipal')
|
||||
|| (process.platform === 'win32' ? `HTTP/${url.hostname}` : `HTTP@${url.hostname}`);
|
||||
|
|
Loading…
Reference in New Issue