Allow app gets the native SSL socket instance in TLS verification callback #3630
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The TLS verification callback,
pjsip_tls_setting.on_verify_cb
, can be used by app to implement its own TLS verification. And there is a request to allow app to set/override the TLS Alert code (for TLS close_notify) when it fails the app's verification (while it passes the OpenSSL verification, so alert code is 0).So, this PR adds the native SSL socket instance to the verification callback which allow app to directly access the native SSL socket, which hopefully it can override the verification result (via
SSL_set_verify_result()
?) and do some other things too if needed.Application using PJLIB SSL socket can get the native SSL socket instance from PJLIB SSL socket info (
pj_ssl_sock_info
).Application using PJSIP TLS transport first gets the PJLIB SSL socket instance from
pjsip_tls_on_verify_param
, then use it to query the PJLIB SSL socket info.Thanks Peter Koletzki for the request/feedback.