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:
parent
d8a9de6203
commit
f097669248
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user