Skip to content

Commit

Permalink
mbedtls: client: check cert exists and is valid
Browse files Browse the repository at this point in the history
It should be SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT, but it was only SSL_VERIFY_FAIL_IF_NO_PEER_CERT, so it didn't verify the cert, it only checked its existence.

To fix that, turn on both just like openssl-server.c does.
  • Loading branch information
ikicha authored and lws-team committed Nov 2, 2024
1 parent c1b609d commit 319b2e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/tls/mbedtls/mbedtls-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ lws_tls_server_client_cert_verify_config(struct lws_vhost *vh)
}

if (!lws_check_opt(vh->options, LWS_SERVER_OPTION_PEER_CERT_NOT_REQUIRED))
verify_options = SSL_VERIFY_FAIL_IF_NO_PEER_CERT;
verify_options |= SSL_VERIFY_FAIL_IF_NO_PEER_CERT;

lwsl_notice("%s: vh %s requires client cert %d\n", __func__, vh->name,
verify_options);
Expand Down

0 comments on commit 319b2e7

Please sign in to comment.