Hans Leidekker : winhttp/tests: Show that WINHTTP_OPTION_SECURE_PROTOCOLS can't be set on connection handles.

Alexandre Julliard julliard at winehq.org
Tue Dec 10 15:58:49 CST 2019


Module: wine
Branch: master
Commit: 2c708d8d9c7b3e4b9886303bc3af3175ce74283b
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=2c708d8d9c7b3e4b9886303bc3af3175ce74283b

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Tue Dec 10 12:12:38 2019 +0100

winhttp/tests: Show that WINHTTP_OPTION_SECURE_PROTOCOLS can't be set on connection handles.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48254
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winhttp/tests/winhttp.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c
index e4c614cb10..3e0e8baeb9 100644
--- a/dlls/winhttp/tests/winhttp.c
+++ b/dlls/winhttp/tests/winhttp.c
@@ -1070,6 +1070,13 @@ static void test_secure_connection(void)
     con = WinHttpConnect(ses, test_winehq, 443, 0);
     ok(con != NULL, "failed to open a connection %u\n", GetLastError());
 
+    SetLastError( 0xdeadbeef );
+    protocols = WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2;
+    ret = WinHttpSetOption(con, WINHTTP_OPTION_SECURE_PROTOCOLS, &protocols, sizeof(protocols));
+    err = GetLastError();
+    ok(!ret, "unexpected success\n");
+    ok(err == ERROR_WINHTTP_INCORRECT_HANDLE_TYPE, "got %u\n", err);
+
     /* try without setting WINHTTP_FLAG_SECURE */
     req = WinHttpOpenRequest(con, NULL, NULL, NULL, NULL, NULL, 0);
     ok(req != NULL, "failed to open a request %u\n", GetLastError());




More information about the wine-cvs mailing list