@@ -2,12 +2,14 @@ import { readFile } from 'node:fs/promises';
22import http from 'node:http' ;
33import https from 'node:https' ;
44import * as jks from 'jks-js' ;
5+ // @ts -expect-error - ts fails to detect that this package provides CJS exports
6+ import * as ohash from 'ohash' ;
57import { createLogger , last } from '@sap-cloud-sdk/util' ;
68/* Careful the proxy imports cause circular dependencies if imported from scp directly */
79// eslint-disable-next-line import/no-internal-modules
810import { getProtocolOrDefault } from '../scp-cf/get-protocol' ;
911// eslint-disable-next-line import/no-internal-modules
10- import { Cache , hashCacheKey } from '../scp-cf/cache' ;
12+ import { Cache } from '../scp-cf/cache' ;
1113import {
1214 addProxyConfigurationInternet ,
1315 getProxyConfig ,
@@ -307,8 +309,7 @@ function createAgent(
307309 options : https . AgentOptions
308310) : HttpAgentConfig | HttpsAgentConfig {
309311 const protocol = getProtocolOrDefault ( destination ) ;
310- const cacheKey = hashCacheKey ( { protocol, options } ) ;
311-
312+ const cacheKey = ohash . hash ( { protocol, options } ) ;
312313 return agentCreateCache . getOrInsertComputed ( cacheKey , ( ) => {
313314 logger . debug (
314315 `Creating new ${ protocol . toUpperCase ( ) } agent for destination ${ destination . name || '<unknown>' } `
0 commit comments