Skip to content

WinHttpSyncHttpClient cannot disable VerifySSL #629

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

Closed
PoundKey opened this issue Aug 4, 2017 · 4 comments
Closed

WinHttpSyncHttpClient cannot disable VerifySSL #629

PoundKey opened this issue Aug 4, 2017 · 4 comments
Labels
bug This issue is a bug.

Comments

@PoundKey
Copy link

PoundKey commented Aug 4, 2017

This might be a bug in the WinHttpSyncHttpClient.
File link: HERE

Line #99

if (!WinHttpSetOption(GetOpenHandle(), WINHTTP_OPTION_SECURITY_FLAGS, &flags, sizeof(flags))) {
     AWS_LOGSTREAM_FATAL(GetLogTag(), "Failed to turn ssl cert ca verification off.");
}

WINHTTP_OPTION_SECURITY_FLAGS cannot be set using the Session handle returned from GetOpenHandle(). According this the official API HERE. In this case, the code block should always return true.

It can be set using the RequestHandle, which is similar to function void* WinHttpSyncHttpClient::OpenRequest Line# 149

if (!WinHttpSetOption(hHttpRequest, WINHTTP_OPTION_DISABLE_FEATURE, &requestFlags, sizeof(requestFlags))) {
   AWS_LOGSTREAM_FATAL(GetLogTag(), "Failed to turn off redirects!");
}

Due to the problem mentioned above, verifying server certificate can not be turned off on Windows 10 and Server 2016 (For some reason, Win 7 bears it)

Thanks

@PoundKey PoundKey changed the title WinHttpSyncHttpClient cannot disable verifySSL WinHttpSyncHttpClient cannot disable VerifySSL Aug 4, 2017
@singku
Copy link
Contributor

singku commented Aug 4, 2017 via email

@PoundKey
Copy link
Author

PoundKey commented Aug 4, 2017

No problem.
This pull request describes the issue fairly well:
https://github.com/aws/aws-sdk-cpp/pull/492/commits

@singku singku added the bug This issue is a bug. label Aug 4, 2017
@singku
Copy link
Contributor

singku commented Aug 4, 2017

Now I understand that part of discussion, thank you. And We have done a similar fix for http proxy setting, it's also only suitable for request handler.

@singku
Copy link
Contributor

singku commented Aug 10, 2017

Fixed, will push out soon

@singku singku closed this as completed Aug 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

2 participants