cli icon indicating copy to clipboard operation
cli copied to clipboard

Missing support for TLS certificates

Open carminalazu opened this issue 5 years ago • 1 comments

Hi,

Are there any plans to add support for TLS certificates?

The only option currently is to use curl which is non-trivial, especially crafting the json body, e.g.

#! https://developer.fastly.com/reference/api/tls/custom-certs/private-keys/
cat > /tmp/key.json <<EOF
{
  "data": {
    "type": "tls_private_key",
    "attributes": {
      "key": "$(echo "$TLS_KEY" | awk '{ printf "%s\\n", $0 }')",
      "name": "changelog.com"
    }
  }
}
EOF
curl --verbose \
  --header "Accept: application/vnd.api+json" \
  --header "Content-Type: application/vnd.api+json" \
  --header "Fastly-Key: $FASTLY_API_TOKEN" \
  --request POST \
  --data @/tmp/key.json \
  https://api.fastly.com/tls/private_keys
                                                                             
#! https://developer.fastly.com/reference/api/tls/custom-certs/certificates/
cat > /tmp/crt.json <<EOF
{
  "data": {
    "type": "tls_certificate",
    "attributes": {
      "cert_blob": "$(echo "$TLS_CRT" | awk '{ printf "%s\\n", $0 }')",
      "name": "changelog.com"
    }
  }
}
EOF
curl --verbose \
  --header "Accept: application/vnd.api+json" \
  --header "Content-Type: application/vnd.api+json" \
  --header "Fastly-Key: $FASTLY_API_TOKEN" \
  --request POST \
  --data @/tmp/crt.json \
  https://api.fastly.com/tls/certificates

Thank you, Carmina.

carminalazu avatar Aug 25 '20 23:08 carminalazu

Any updates on this, folks?

cori avatar Nov 19 '21 19:11 cori

TLS support was added in v3.3.0 https://github.com/fastly/cli/releases/tag/v3.3.0

https://github.com/fastly/cli/pull/630

Integralist avatar Sep 28 '22 13:09 Integralist