从Windows PC将json请求发布到https url时出现SSL连接错误的原因可能是什么?

问题描述

我正在Visual Studio中为C ++应用程序使用libcurl.dll版本7.72.0.0。

当我在一台装有Service Pack 1的Windows 7 PC上将JSON请求发布到HTTPS URL时,该请求已成功发布。但是在其他操作系统与Windows 7 Service Pack 1相同的PC上,我从curl_easy_perform()收到响应代码35:SSL连接错误。

同一C ++代码在一台Windows 7 PC上运行而在另一台Windows 7 PC上出现错误的原因可能是什么?两台PC都在同一网络上。

以下是C ++代码:

curl_easy_setopt(curl,CURLOPT_URL,Url.c_str());

curl_easy_setopt(curl,CURLOPT_HTTPHEADER,header);
 
// send all data to this function  
curl_easy_setopt(curl,CURLOPT_WRITEFUNCTION,WriteMemoryCallback);
 
// we pass our 'chunk' struct to the callback function 
curl_easy_setopt(curl,CURLOPT_WRITEDATA,(void *)&sResponse);
 
//some servers don't like requests that are made without a user-agent
//  field,so we provide one
curl_easy_setopt(curl,CURLOPT_USERAGENT,"libcurl-agent/1.0");
 
curl_easy_setopt(curl,CURLOPT_POSTFIELDS,postthis);
printf("\npostthisData=%s\n",postthis);
        
if (itsHTTPSRequest)
    curl_easy_setopt(curl,CURLOPT_SSL_VERIFYPEER,0);

// if we don't provide POSTFIELDSIZE,libcurl will strlen() by
//   itself 
curl_easy_setopt(curl,CURLOPT_POSTFIELDSIZE,(long)strlen(postthis));

curl_easy_setopt( curl,CURLOPT_CONNECTTIMEOUT,m_RWTimeOut );
curl_easy_setopt( curl,CURLOPT_LOW_SPEED_TIME,m_RWTimeOut);
curl_easy_setopt( curl,CURLOPT_LOW_SPEED_LIMIT,30L);

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...