1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-04 16:45:06 -05:00

mbedtls: use VERIFYHOST

Previously, VERIFYPEER would enable/disable all checks.

Reported-by: Eric Rosenquist
Fixes #3376
Closes #3380
This commit is contained in:
Daniel Stenberg 2018-12-17 13:08:41 +01:00
parent d8a9de6203
commit f097669248
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -583,14 +583,16 @@ mbed_connect_step2(struct connectdata *conn,
return CURLE_PEER_FAILED_VERIFICATION;
}
if(ret & MBEDTLS_X509_BADCERT_CN_MISMATCH)
failf(data, "Cert verify failed: BADCERT_CN_MISMATCH");
if(ret & MBEDTLS_X509_BADCERT_NOT_TRUSTED)
failf(data, "Cert verify failed: BADCERT_NOT_TRUSTED");
return CURLE_PEER_FAILED_VERIFICATION;
}
if(ret && SSL_CONN_CONFIG(verifyhost)) {
if(ret & MBEDTLS_X509_BADCERT_CN_MISMATCH)
failf(data, "Cert verify failed: BADCERT_CN_MISMATCH");
return CURLE_PEER_FAILED_VERIFICATION;
}
peercert = mbedtls_ssl_get_peer_cert(&BACKEND->ssl);