tls_openssl: only verify client certs if configured to require them #3281
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.
Summary
If you want opensips to verify server certs you have to enable
verify_cert
, but this also implicitly makes it verify client certs, when presented, even if you don't haverequire_client_cert
enabled.Details
There was previously no way to configure opensips to verify server certs without having it also verify client certs, even if you configured it to make client certs optional!
Solution
This PR makes
verify_cert
only apply in the case of opensips connecting out to a server, andrequire_client_cert
only apply in the case of a client connecting into opensips.Compatibility
The only scenario I can imagine it breaking is if you have
require_client_cert
but notverify_cert
, in which case formerly it would allow any client cert (but require some client cert to be presented), but now it would verify the client certificate. I don't expect this to be a problem because what is the point in requiring a client cert if you don't verify it?Closing issues