Make rejectUnauthorized true if ca cert is passed for k8s auth method

This commit is contained in:
Tuan Dang
2024-05-14 22:49:37 -07:00
parent e4afbe8662
commit ace008f44e
@@ -115,11 +115,9 @@ export const identityKubernetesAuthServiceFactory = ({
"Content-Type": "application/json", "Content-Type": "application/json",
Authorization: `Bearer ${tokenReviewerJwt}` Authorization: `Bearer ${tokenReviewerJwt}`
}, },
...(caCert && { httpsAgent: new https.Agent({
httpsAgent: new https.Agent({ ca: caCert,
ca: caCert, rejectUnauthorized: !!caCert
rejectUnauthorized: true
})
}) })
} }
); );