pjproject icon indicating copy to clipboard operation
pjproject copied to clipboard

Fixed assertion in Apple SSL when verification is retried

Open sauwming opened this issue 3 years ago • 0 comments

To fix #2930.

It is reported that initiating SSL connection can trigger an assertion: Assertion failed: (ssock->send_buf.max_len == 0), function ssock_on_connect_complete, file ../src/pj/ssl_sock_imp_common.c, line 1134.

Upon investigation, it turns out that server can retry the client verification, i.e. invoke the client's verification block more than once. This causes client to receive duplicate EVENT_CONNECT, which triggers the assertion. The proposed solution is to issue EVENT_CONNECT only if the SSL state is NULL, to prevent it being called more than once.

Also in this PR is to add more logging to print the trust evaluation result, so we can know whether cert verification can potentially be retried by server.

sauwming avatar Mar 22 '22 09:03 sauwming