Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature flag to use WinInet client not WinHttp #1284

Merged
merged 2 commits into from
Feb 1, 2024
Merged

Conversation

poodlewars
Copy link
Collaborator

@poodlewars poodlewars commented Jan 31, 2024

This shows how to use WinInet client rather than WinHttp.

This gives better error messages in the AWS SDK logs for cert errors:

[DEBUG] 2024-01-31 11:02:44.560 WinInetSyncHttpClient [28240] amz-sdk-invocation-id: 15325992-86D2-49FF-B122-11A6CC210E4F

amz-sdk-request: attempt=1

authorization: AWS4-HMAC-SHA256 Credential=6pWBXggusk9MPFTpvj5G/20240131/us-east-1/s3/aws4_request, SignedHeaders=amz-sdk-invocation-id;amz-sdk-request;content-type;host;x-amz-api-version;x-amz-content-sha256;x-amz-date, Signature=5873b05fa185391c2d1b65ab337296164b313c979f26c00cde0640381cc46eac

content-type: application/xml

host: localhost:9000

user-agent: aws-sdk-cpp/1.11.201 ua/2.0 md/aws-crt#0.24.7 os/Windows#10.0.22621.2506 md/arch#AMD64 lang/c++#C++199711L md/MSVC#1937 cfg/retry-mode#default api/S3

x-amz-api-version: 2006-03-01

x-amz-content-sha256: UNSIGNED-PAYLOAD

x-amz-date: 20240131T110244Z


[WARN] 2024-01-31 11:02:44.579 WinInetSyncHttpClient [28240] Send request failed: The certificate authority is invalid or incorrect

Compared to WinHttp, which just says,

A security error occurred.

However, we can't merge this without a feature flag because the SSL verification disablement doesn't seem to work with this client, the AWS SDK logs:

[WARN] 2024-01-31 11:02:42.684 WinInetSyncHttpClient [28240] Turning ssl unknown ca verification off.
[FATAL] 2024-01-31 11:02:42.684 WinInetSyncHttpClient [28240] Failed to turn ssl cert ca verification off.

I've tested that this change does not affect Linux, even when the feature flag is set.

@poodlewars poodlewars changed the title Do not merge: Use WinInet client not WinHttp Feature flag to use WinInet client not WinHttp Jan 31, 2024
@poodlewars poodlewars marked this pull request as ready for review January 31, 2024 14:10
Copy link
Collaborator

@DrNickClarke DrNickClarke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@poodlewars poodlewars merged commit 59dc636 into master Feb 1, 2024
130 checks passed
@poodlewars poodlewars deleted the wininet-client branch February 1, 2024 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants