diff --git a/src/requests/adapters.py b/src/requests/adapters.py index 79ed426566..e2f04bda25 100644 --- a/src/requests/adapters.py +++ b/src/requests/adapters.py @@ -353,12 +353,12 @@ def cert_verify( conn.cert_file = cert conn.key_file = None if conn.cert_file and not os.path.exists(conn.cert_file): - raise OSError( + raise FileNotFoundError( f"Could not find the TLS certificate file, " f"invalid path: {conn.cert_file}" ) if conn.key_file and not os.path.exists(conn.key_file): - raise OSError( + raise FileNotFoundError( f"Could not find the TLS key file, invalid path: {conn.key_file}" )