Skip to content

mbedtls: no longer use MBEDTLS_SSL_VERIFY_OPTIONAL - #14591

Closed
jan2000 wants to merge 2 commits into
curl:masterfrom
jan2000:mbedtls-verify-required
Closed

jan2000 wants to merge 2 commits into
curl:masterfrom
jan2000:mbedtls-verify-required

Conversation

@jan2000

@jan2000 jan2000 commented Aug 19, 2024

Copy link
Copy Markdown
Contributor

With mbedTLS if the minimum version of TLS is set to 1.3, MBEDTLS_SSL_VERIFY_OPTIONAL is not available in client mode. See: https://github.com/Mbed-TLS/mbedtls/blob/2ca6c285/library/ssl_tls.c#L1357
Also, there might be plans to remove it completely in future mbedTLS versions.

So, switch to always using MBEDTLS_SSL_VERIFY_REQUIRED. If verifypeer or verifyhost are disabled the corresponding error flags are cleared in the verify callback function. That is also where verification errors are logged.

Depends on #14588

@github-actions github-actions Bot added the TLS label Aug 19, 2024
@bagder

bagder commented Aug 19, 2024

Copy link
Copy Markdown
Member

Note: "This branch has conflicts that must be resolved". Can you take a look?

In prepation of removal of MBEDTLS_SSL_VERIFY_OPTIONAL.
With mbedTLS if the minimum version of TLS is set to 1.3,
MBEDTLS_SSL_VERIFY_OPTIONAL is not available in client mode. See:
https://github.com/Mbed-TLS/mbedtls/blob/2ca6c285/library/ssl_tls.c#L1357
Also, there might be plans to remove it completely in future mbedTLS
versions.

So, switch to always using MBEDTLS_SSL_VERIFY_REQUIRED. If verifypeer
or verifyhost are disabled the corresponding error flags are cleared
in the verify callback function. That is also where verification
errors are logged.
@jan2000
jan2000 force-pushed the mbedtls-verify-required branch from 24f453c to 974f255 Compare August 19, 2024 14:21
@jan2000

jan2000 commented Aug 19, 2024

Copy link
Copy Markdown
Contributor Author

Hmm.. I am not quite sure what the best way is to do continuation PRs (this PR depends on that PR) with github. When I rebased locally there were no conflicts. Its a shame that github does not (at least that I known) provide such functionality.

@vszakats

Copy link
Copy Markdown
Member

There was a merge queue feature announced earlier: https://github.blog/changelog/2023-07-12-pull-request-merge-queue-is-now-generally-available/
(that's all I know about it)

@bagder bagder closed this in 925aea1 Aug 20, 2024
@jan2000
jan2000 deleted the mbedtls-verify-required branch August 20, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants