libstrophe를 사용하여 C에서 간단한 ejabberd 클라이언트를 개발 중입니다. 그것은 연결되어 있어야하고 예상대로 메시지를 처리하기 시작합니다.Strophe 복구 할 수없는 TLS 오류
그러나 잠시 후 (ejabberd 서버에서 두 번 또는 세 번 실행 한 후) 연결이 닫히고 상태는 DISCONNECTED
으로 설정됩니다. 아래는 디버그 라인의 꼬리입니다.
xmpp DEBUG Unrecoverable TLS error, 5.
xmpp DEBUG Closing socket.
DEBUG: disconnected event DEBUG Stopping event loop.
event DEBUG Event
oop completed.
다음과 같이 초기화하고 연결합니다.
xmpp_initialize();
/* read connection params */
if(set_xmpp_conn_params(&conn_params) < 0) {
fprintf(stderr, "Could not retrieve connection params from %s\n",
SERVER_CONF_FILE);
return -1;
}
/* initialize the XMPP logger */
xmpp_log = xmpp_get_default_logger(XMPP_LOG_LEVEL);
xmpp_ctx = xmpp_ctx_new(NULL, xmpp_log);
/* create a connection */
xmpp_conn = xmpp_conn_new(xmpp_ctx);
/* login */
xmpp_conn_set_jid(xmpp_conn, conn_params.jid);
xmpp_conn_set_pass(xmpp_conn, conn_params.password);
/* create a client */
xmpp_connect_client( xmpp_conn, conn_params.host, 0,
agent_conn_handler, xmpp_ctx);
/* enter the event loop */
xmpp_run(xmpp_ctx);
/* the code below is executed
whenever connection handler @agent_conn_handler exits */
/* release the connection and context */
xmpp_conn_release(xmpp_conn);
xmpp_ctx_free(xmpp_ctx);
왜 TLS 오류 메시지가 표시됩니까?
감사합니다.
TLS에 openssl, gnutls 또는 schannel을 사용하고 있습니까? –
예,'openssl'을 사용하고 있습니다. –