Commit e27ff36f authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

winhttp: Added WINHTTP_OPTION_CLIENT_CERT_CONTEXT option stub.

parent 3edc4b27
...@@ -999,6 +999,14 @@ static BOOL request_set_option( object_header_t *hdr, DWORD option, LPVOID buffe ...@@ -999,6 +999,14 @@ static BOOL request_set_option( object_header_t *hdr, DWORD option, LPVOID buffe
if (!(session->proxy_password = buffer_to_str( buffer, buflen ))) return FALSE; if (!(session->proxy_password = buffer_to_str( buffer, buflen ))) return FALSE;
return TRUE; return TRUE;
} }
case WINHTTP_OPTION_CLIENT_CERT_CONTEXT:
if (!(hdr->flags & WINHTTP_FLAG_SECURE))
{
SetLastError( ERROR_WINHTTP_INCORRECT_HANDLE_STATE );
return FALSE;
}
FIXME("WINHTTP_OPTION_CLIENT_CERT_CONTEXT\n");
return TRUE;
default: default:
FIXME("unimplemented option %u\n", option); FIXME("unimplemented option %u\n", option);
set_last_error( ERROR_INVALID_PARAMETER ); set_last_error( ERROR_INVALID_PARAMETER );
...@@ -1224,7 +1232,7 @@ static BOOL set_option( object_header_t *hdr, DWORD option, LPVOID buffer, DWORD ...@@ -1224,7 +1232,7 @@ static BOOL set_option( object_header_t *hdr, DWORD option, LPVOID buffer, DWORD
{ {
BOOL ret = TRUE; BOOL ret = TRUE;
if (!buffer) if (!buffer && buflen)
{ {
set_last_error( ERROR_INVALID_PARAMETER ); set_last_error( ERROR_INVALID_PARAMETER );
return FALSE; return FALSE;
......
...@@ -994,6 +994,9 @@ static void test_secure_connection(void) ...@@ -994,6 +994,9 @@ static void test_secure_connection(void)
req = WinHttpOpenRequest(con, NULL, NULL, NULL, NULL, NULL, 0); req = WinHttpOpenRequest(con, NULL, NULL, NULL, NULL, NULL, 0);
ok(req != NULL, "failed to open a request %u\n", GetLastError()); ok(req != NULL, "failed to open a request %u\n", GetLastError());
ret = WinHttpSetOption(req, WINHTTP_OPTION_CLIENT_CERT_CONTEXT, WINHTTP_NO_CLIENT_CERT_CONTEXT, 0);
ok(!ret && GetLastError() == ERROR_WINHTTP_INCORRECT_HANDLE_STATE, "setting client cert context returned %x (%u)\n", ret, GetLastError());
ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0);
err = GetLastError(); err = GetLastError();
if (!ret && (err == ERROR_WINHTTP_CANNOT_CONNECT || err == ERROR_WINHTTP_TIMEOUT)) if (!ret && (err == ERROR_WINHTTP_CANNOT_CONNECT || err == ERROR_WINHTTP_TIMEOUT))
...@@ -1017,6 +1020,9 @@ static void test_secure_connection(void) ...@@ -1017,6 +1020,9 @@ static void test_secure_connection(void)
req = WinHttpOpenRequest(con, NULL, NULL, NULL, NULL, NULL, WINHTTP_FLAG_SECURE); req = WinHttpOpenRequest(con, NULL, NULL, NULL, NULL, NULL, WINHTTP_FLAG_SECURE);
ok(req != NULL, "failed to open a request %u\n", GetLastError()); ok(req != NULL, "failed to open a request %u\n", GetLastError());
ret = WinHttpSetOption(req, WINHTTP_OPTION_CLIENT_CERT_CONTEXT, WINHTTP_NO_CLIENT_CERT_CONTEXT, 0);
ok(ret, "failed to set client cert context %u\n", GetLastError());
WinHttpSetStatusCallback(req, cert_error, WINHTTP_CALLBACK_STATUS_SECURE_FAILURE, 0); WinHttpSetStatusCallback(req, cert_error, WINHTTP_CALLBACK_STATUS_SECURE_FAILURE, 0);
ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0);
......
...@@ -63,6 +63,8 @@ typedef int INTERNET_SCHEME, *LPINTERNET_SCHEME; ...@@ -63,6 +63,8 @@ typedef int INTERNET_SCHEME, *LPINTERNET_SCHEME;
#define WINHTTP_NO_PROXY_NAME NULL #define WINHTTP_NO_PROXY_NAME NULL
#define WINHTTP_NO_PROXY_BYPASS NULL #define WINHTTP_NO_PROXY_BYPASS NULL
#define WINHTTP_NO_CLIENT_CERT_CONTEXT NULL
#define WINHTTP_NO_REFERER NULL #define WINHTTP_NO_REFERER NULL
#define WINHTTP_DEFAULT_ACCEPT_TYPES NULL #define WINHTTP_DEFAULT_ACCEPT_TYPES NULL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment