-
Notifications
You must be signed in to change notification settings - Fork 156
Open
Labels
is:bugBug description.Bug description.status:completedFrom the developer perspective, the issue was solved (bug fixed, question answered,...)From the developer perspective, the issue was solved (bug fixed, question answered,...)
Description
Hi @michalvasko,
libnetconf2 version 4.4.2.
Scenario: If the CA cert at the netconf server is not a valid for netconf client. Establishing Netconf session using call-home with TLS ends up not closing fd.
Code snippet: nc_client_tls_session_new() in session_client_tls.c from line 294 to 324.
sock = -1;
...
while ((ret = nc_client_tls_handshake_step_wrap(tls_session, sock_tmp)) == 0) {
usleep(NC_TIMEOUT_STEP);
if ((timeout > -1) && (nc_timeouttime_cur_diff(&ts_timeout) < 1)) {
ERR(NULL, "SSL connect timeout.");
goto fail;
}
}
/* check if handshake was ok */
if (nc_client_tls_connect_check(ret, tls_session, host) != 1) {
goto fail;
}
*out_tls_cfg = tls_cfg;
return tls_session;
fail:
//************As the sock is set to -1 above. Flow will never enter inside _if_ block and sock is not closed.
if (sock > -1) {
close(sock);
}
Please let us know if its a known issue.
Thanks.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
is:bugBug description.Bug description.status:completedFrom the developer perspective, the issue was solved (bug fixed, question answered,...)From the developer perspective, the issue was solved (bug fixed, question answered,...)