问题如下:
[tls]mbedtls client struct init success...
[D/MQTT] ipv4 address port: 8883
[D/MQTT] HOST = www.vinin-cloud.com
[tls]Loading the CA root certificate success...
[tls]mbedtls client context init success...
[tls]mbedtls_net_connect err returned -0x52
[E/MQTT] mbedtls_client_connect err return : -0x52
[E/MQTT] Net connect error(-1)
调试发现卡在
int mbedtls_net_connect( mbedtls_net_context *ctx, const char *host, const char port, int proto )
.....................
/ Do name resolution with both IPv6 and IPv4 */
memset( &hints, 0, sizeof( hints ) );
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = proto == MBEDTLS_NET_PROTO_UDP ? SOCK_DGRAM : SOCK_STREAM;
hints.ai_protocol = proto == MBEDTLS_NET_PROTO_UDP ? IPPROTO_UDP : IPPROTO_TCP;
if( getaddrinfo( host, port, &hints, &addr_list ) != 0 )
return( MBEDTLS_ERR_NET_UNKNOWN_HOST );
返回
MBEDTLS_ERR_NET_UNKNOWN_HOST
估计是执行getaddrinfo出问题
请问有使用过MQTT tls组件的吗?
求教
更多回帖