visual c++ - WinHttp doesn't download from Amazon S3 on WinXP -
recently amazon has disabled support of ssl s3 buckets , seems causes problems on win xp sp3. use code
hsession = winhttpopen(l"mysession", winhttp_access_type_default_proxy, winhttp_no_proxy_name, winhttp_no_proxy_bypass, 0); if (bhttps) { dword flags = winhttp_flag_secure_protocol_tls1; winhttpsetoption(hsession, winhttp_option_secure_protocols, &flags, sizeof(flags)); } port = bhttps ? internet_default_https_port : internet_default_http_port; hconnect = winhttpconnect(hsession, srv_w, port, 0); hrequest = winhttpopenrequest(hconnect, vrb_w, adr_w, null, winhttp_no_referer, null, winhttp_flag_refresh | (bhttps ? winhttp_flag_secure : 0)); if (bhttps) { dword dwsecflag = security_flag_ignore_cert_cn_invalid | security_flag_ignore_cert_date_invalid | security_flag_ignore_unknown_ca | security_flag_ignore_cert_wrong_usage; winhttpsetoption(hrequest, winhttp_option_security_flags, &dwsecflag, sizeof(dwsecflag)); } winhttpsendrequest(hrequest, hdr_w, (headers != null) ? -1 : 0, data, size, size, 0); winhttpreceiveresponse(hrequest, null);
this works on win7 , worked month or ago on winxp. winhttp error 12152: server returned invalid or unrecognized response. have enabled tracing , log fiel has different error:
17:47:47.057 ::*0000001* :: winhttpsendrequest(0x10a0000, "", 0, 0x0, 0, 0, 0) 17:47:47.135 ::*0000001* :: "s3.amazonaws.com" resolved 17:47:47.307 ::*0000001* :: winsock/rpc/ssl/transport error: 0x90312 [sec_i_continue_needed]
is there way fix problem without using 3rd party libraries? (browsers, including ie, download files without problems).
i'm having same issue. think may caused problem ssl_rsa_with_3des_ede_sha cipher chosen in winhttp on xp. try test: on xp machine, add new dword value called "enabled" key:
hkey_local_machine\system\currentcontrolset\control\securityproviders\schannel\ciphers\triple des 168/168
this disables cipher , seems fix issue me. not ideal solution however, , i'm still not sure of underlying issue. perhaps problem whatever crypto provider amazon using?
Comments
Post a Comment