HP-Socket icon indicating copy to clipboard operation
HP-Socket copied to clipboard

CHttpsSyncClientPtr 使用 OpenUrl 请求https 接口 返回错误 1-Operation not permitted

Open AdonLuo opened this issue 3 years ago • 2 comments

你好,博主: 如题: 使用环境:Centos7.9 HP版本:5.8.4 ,其中so 为群里下载使用,未进行自定义编译

简要使用部分代码: CHttpsSyncClientPtr https(nullptr); xxxx if (https->OpenUrl("POST", url.toStdString().c_str(), headers, header_sz, (const BYTE*)req_body.data(), req_body.size()) == FALSE) { auto err = ::SYS_GetLastError(); auto err_desc = ::SYS_GetLastErrorStr(); // 错误信息: 1-Operation not permitted }

结果:url 为 https 时,请求失败,返回错误信息:1-Operation not permitted 请教下博主,这种情况如何定位问题,有什么解决办法?目前不清楚问题出在哪,是so库问题还是使用方法错误导致?谢谢!

AdonLuo avatar Jun 15 '22 11:06 AdonLuo

未进行ssl 环境初始化导致, 最开始报错: 71-Protocol error 是使用了CHttpSyncClientPtr 的对象

AdonLuo avatar Jun 16 '22 04:06 AdonLuo

HTTPS需要初始化SSL环境

ldcsaa avatar Jul 17 '22 15:07 ldcsaa