aws-sdk-cpp icon indicating copy to clipboard operation
aws-sdk-cpp copied to clipboard

WinHttp TLS is completely disabled if m_verifySSL is false

Open renjipanicker opened this issue 1 year ago • 1 comments

Describe the bug

In the file;: aws-cpp-sdk-core/source/http/windows/WinHttpSyncHttpClient.cpp

Line 541 (in function OpenRequest): DWORD requestFlags = request->GetUri().GetScheme() == Scheme::HTTPS && m_verifySSL ? WINHTTP_FLAG_SECURE : 0;

This code passes 0 instead of WINHTTP_FLAG_SECURE if m_verifySSL is false. Therefore the connection is not TLS enabled.

This is incorrect behaviour.

Expected Behavior

If the scheme is HTTPS and m_verifySSL is false, it should initiate a TLS connection, and ignore certificate errors.

Current Behavior

If the scheme is HTTPS and m_verifySSL is false, it initiates a non-TLS connection.

Reproduction Steps

Create an outgoing HTTPS request to S3, and set m_verifySSL to false. Use Wireshark or equivalent to observe that the connection is not TLS enabled.

Possible Solution

Remove the && m_verifySSL from the condition.

Additional Information/Context

No response

AWS CPP SDK version used

1.11.285

Compiler and Version used

Visual Studio 2019

Operating System and version

Windows Server 2019

renjipanicker avatar Jun 18 '24 14:06 renjipanicker

Thanks for finding this bug and pointing it out to us. We are working on a fix.

jmklix avatar Jun 19 '24 16:06 jmklix

Created https://github.com/aws/aws-sdk-cpp/pull/3313 which will revert to the old behavior, and creates a client configuraiton for users to use anonymous auth to satisfy the original issue.

sbiscigl avatar Feb 24 '25 23:02 sbiscigl

should be fixed on main now, tagged this afternoon, give a shout if you have any questions

sbiscigl avatar Feb 25 '25 18:02 sbiscigl

This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.

github-actions[bot] avatar Feb 25 '25 18:02 github-actions[bot]