本文介绍了Winhttpsetoption未设置WINHTTP_OPTION_SECURE_PROTOCOLS选项,返回0作为返回值。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

IWinHttpRequest接口正常工作,直到TLS版本从服务器端更改为止。服务器的TLS版本已更改为TLSv1.1及更高版本。



由于此更改,我无法从服务器获得任何响应。



所以我决定使用WinHttpSetOption来设置协议版本。但它不起作用。



请有人帮帮我吗?



我是什么尝试过:



IWinHttpRequest接口工作正常,直到从服务器端更改TLS版本。服务器的TLS版本已更改为TLSv1.1及更高版本。



由于此更改,我无法从服务器获得任何响应。



所以我决定使用WinHttpSetOption来设置协议版本。但它不起作用。



以下代码是我设置选项的地方。



IWinHttpRequest interface was working fine until TLS version has been changed from Server side. TLS version of server has been changed to TLSv1.1 and higher.

because of this change I am not able to get any response from server.

So I decided to use WinHttpSetOption to set protocol version. but it doesn't work.

Please anybody can help me?

What I have tried:

IWinHttpRequest interface was working fine until TLS version has been changed from Server side. TLS version of server has been changed to TLSv1.1 and higher.

because of this change I am not able to get any response from server.

So I decided to use WinHttpSetOption to set protocol version. but it doesn't work.

The below code is where I set the options.

dwVal = WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_1 | WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_2; 
bRet = WinHttpSetOption(request_,WINHTTP_OPTION_SECURE_PROTOCOLS,&dwVal,sizeof(dwVal)); 
if(!bRet)
{ 
TRACE("error - " , GetLastError());

	break; 
}







上面的代码不会产生任何错误代码,尽管返回代码为setoption为零。




The above code doers not yield any error code although the return code for setoption is zero.

推荐答案



这篇关于Winhttpsetoption未设置WINHTTP_OPTION_SECURE_PROTOCOLS选项,返回0作为返回值。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 17:05