Configure the Swift Client to Work With HTTP

JFrog Artifactory Documentation

Products
JFrog Artifactory
Content Type
User Guide
ft:sourceType
Paligo

By default, the Swift Client only works with HTTPS protocol. If you attempt to configure the client with an HTTP URL, you will get the following error:

Error: invalid URL:<URL>

To modify the Swift client to work with the HTTP protocol, do the following:

  1. To set Artifactory as a Swift repository, run the following command using an HTTPS URL:

    swift package-registry set <url>

    This creates the .swiftpm/configuration/registries.json file, which contains the following information:

    {
      "registries" : {
        "[default]" : {
          "url" : "<url to RT>/artifactory/api/swift/swift-local"
        }
      },
      "version" : 1
    }
  2. Modify the URL in the <url to RT> field in the .swiftpm/configuration/registries.json file to HTTP instead of HTTPS.