Skip to content

Commit

Permalink
fix(iam): oidc-provider can't pull from hosts requiring SNI (aws#13397)
Browse files Browse the repository at this point in the history
This enables SNI when the oidcProvider tries to pull the thumbprint from a server in the downloadThumbprint function.  This fixes issues when trying to add an oidcProvider that is using SNI.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
creiche authored and cornerwings committed Mar 8, 2021
1 parent 0450926 commit 6fdefa3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-iam/lib/oidc-provider/external.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async function downloadThumbprint(issuerUrl: string) {
if (!purl.host) {
return ko(new Error(`unable to determine host from issuer url ${issuerUrl}`));
}
const socket = tls.connect(port, purl.host, { rejectUnauthorized: false });
const socket = tls.connect(port, purl.host, { rejectUnauthorized: false, servername: purl.host });
socket.once('error', ko);
socket.once('secureConnect', () => {
const cert = socket.getPeerCertificate();
Expand Down

0 comments on commit 6fdefa3

Please sign in to comment.