【问题标题】:SSL Exception in POCO C++POCO C++ 中的 SSL 异常
【发布时间】:2012-06-08 02:43:06
【问题描述】:

当我使用

完成构建 POCO 库时
Win32OpenSSL-1_0_1c.exe
poco-1.4.3p1-all

我首先感到高兴,因为我可以使用HTTPS来编写我的程序。但是,我遇到了一个异常

msg = "error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol

当我使用 HTTPSClientSession 发送请求时。我的代码如下:

try{

Context::Ptr pContext = new Context(Context::CLIENT_USE, "", "", "", Context::VERIFY_RELAXED, 9, true, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
HTTPSClientSession session(pContext);
Poco::URI uri("...");//private server with https
session.setHost(uri.getHost());
session.setKeepAlive(true);
HTTPRequest request(HTTPRequest::HTTP_POST);
session.sendRequest(request) << ...;
char m_arrayRet[1024];
HTTPResponse response;
std::istream& res = session.receiveResponse(response);
while(!res.eof())
res.read(m_arrayRet,1024);
m_arrayRet[res.gcount()] = '\0';
}
catch{
std::cerr << exc.displayText() << std::endl;
}

嗯,我的代码对吗?这是我第一次使用这个库,希望大家帮助我,谢谢!!!

【问题讨论】:

    标签: c++ exception https poco-libraries


    【解决方案1】:

    我自己已经解决了这个问题。谢谢大家。 原因是443端口没有设置,poco语法地址不对

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-07-25
      • 1970-01-01
      • 1970-01-01
      • 2022-08-02
      • 2014-09-06
      • 1970-01-01
      • 1970-01-01
      • 2011-03-01
      相关资源
      最近更新 更多