UI/updater: Use TLS 1.2 with WinHTTP
On Windows 7, WinHTTP defaults to using only SSL3 and TLS 1.0. The obsproject.com server was updated to remove TLS 1.0 support and this has caused updates to stop working on Windows 7.
This commit is contained in:
parent
27d16f961b
commit
05fb67717e
@ -88,6 +88,8 @@ bool HTTPPostData(const wchar_t *url,
|
||||
|
||||
const wchar_t *acceptTypes[] = {L"*/*", nullptr};
|
||||
|
||||
const DWORD tlsProtocols = WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2;
|
||||
|
||||
responseBuf.clear();
|
||||
|
||||
/* -------------------------------------- *
|
||||
@ -109,7 +111,7 @@ bool HTTPPostData(const wchar_t *url,
|
||||
/* -------------------------------------- *
|
||||
* connect to server */
|
||||
|
||||
hSession = WinHttpOpen(L"OBS Updater/2.1",
|
||||
hSession = WinHttpOpen(L"OBS Studio Updater/2.1",
|
||||
WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,
|
||||
WINHTTP_NO_PROXY_NAME,
|
||||
WINHTTP_NO_PROXY_BYPASS,
|
||||
@ -119,6 +121,9 @@ bool HTTPPostData(const wchar_t *url,
|
||||
return false;
|
||||
}
|
||||
|
||||
WinHttpSetOption(hSession, WINHTTP_OPTION_SECURE_PROTOCOLS,
|
||||
(LPVOID)&tlsProtocols, sizeof(tlsProtocols));
|
||||
|
||||
hConnect = WinHttpConnect(hSession, hostName,
|
||||
secure
|
||||
? INTERNET_DEFAULT_HTTPS_PORT
|
||||
|
@ -344,6 +344,8 @@ static inline void CleanupPartialUpdates()
|
||||
|
||||
bool DownloadWorkerThread()
|
||||
{
|
||||
const DWORD tlsProtocols = WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2;
|
||||
|
||||
HttpHandle hSession = WinHttpOpen(L"OBS Studio Updater/2.1",
|
||||
WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,
|
||||
WINHTTP_NO_PROXY_NAME,
|
||||
@ -355,6 +357,9 @@ bool DownloadWorkerThread()
|
||||
return false;
|
||||
}
|
||||
|
||||
WinHttpSetOption(hSession, WINHTTP_OPTION_SECURE_PROTOCOLS,
|
||||
(LPVOID)&tlsProtocols, sizeof(tlsProtocols));
|
||||
|
||||
HttpHandle hConnect = WinHttpConnect(hSession, L"obsproject.com",
|
||||
INTERNET_DEFAULT_HTTPS_PORT, 0);
|
||||
if (!hConnect) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user