如何破译升压ASIO SSL错误code? [英] How to decipher a boost asio ssl error code?

查看:285
本文介绍了如何破译升压ASIO SSL错误code?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个升压ASIO SSL实现一个偶然的通信故障,由升压返回超级有用的错误消息为asio.ssl:336458004

I've got an occasional communications failure in a boost asio ssl implementation, the super helpful error message returned by boost is 'asio.ssl:336458004'

我怀疑数字的数字是某种SSL标志组成的集合体结构,我这样说是因为Linux的错误codeS,升压ASIO错误codeS和SSL错误codeS不以'336458004'任何引用,所以presumably必须动态构造。

I suspect that the numerical figure is some sort of aggregate construct composed of SSL flags, I say that because the linux error codes, the boost asio error codes and the ssl error codes do not have any reference to '336458004', so presumably it must be constructed dynamically.

任何人都可以提供一些洞察我应该怎么破译这个错误code?谢谢。

Can anyone provide some insight into how I should decipher this error code?, Thanks.

推荐答案

他们使用ERR_PACK从加密/ ERR / err.h

they use ERR_PACK from crypto/err/err.h

这将使转换误差为字符串

this will allow converting error to string

string err = error.message()
if (error.category() == boost::asio::error::get_ssl_category()) {
    err = string(" (")
            +boost::lexical_cast<string>(ERR_GET_LIB(error.value()))+","
            +boost::lexical_cast<string>(ERR_GET_FUNC(error.value()))+","
            +boost::lexical_cast<string>(ERR_GET_REASON(error.value()))+") "
    ;
    //ERR_PACK /* crypto/err/err.h */
    char buf[128];
    ::ERR_error_string_n(error.value(), buf, sizeof(buf));
    err += buf;
}

大概不包括在升压所以使用纯套接字时ASIO并不需要链接到SSL

Probably not included in boost so asio does not need link to ssl when using pure sockets

这篇关于如何破译升压ASIO SSL错误code?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆