ARTIFACTORY: How to Resolve a 400 Bad Request Error When Trying to Download or Resolve Artifacts
For those versions of Artifactory that require redirects and make use of our Direct Cloud Storage option (i.e., Enterprise+, On-Premise, and JFrog's SaaS-based system), you may encounter a 400 bad request error. This happens to downloads when the request is made from some old HTTP clients, which do not support redirects. For example, here’s the response from an old cURL https client:
As per our tests, old versions of cURL and old versions of wget produced this behavior (although newer versions of these clients served the request successfully). Moreover, when using a Gradle client to resolve from a Maven repository, the request will always fail regardless of the version.
Typically, only one authentication method is applied (bearer or basic). This error occurs because both are in play. As a result, Artifactory-bound authentication is incorrectly forwarded to Amazon's S3 service.
To resolve this error, when using cURL you’ll need to upgrade the client to version 7.58.0 or above. With wget, you’ll need to upgrade the client to version 1.20.3 or above. If you’re using Gradle as your build tool, have a look HERE at the published vulnerability, which describes this error issue in detail and its fix in version 5.6.
Published: Feb. 24, 2020
Last updated: Dec. 21, 2020
Keywords: 400 bad request, Direct Cloud Storage