logo
down
shadow

Wonder why trying to upload a Letsencrypt .pem certificate using cURL to Cloudflare API throws "Malformed JSON in r


Wonder why trying to upload a Letsencrypt .pem certificate using cURL to Cloudflare API throws "Malformed JSON in r

By : user2185466
Date : November 21 2020, 04:01 AM
around this issue I searched Google extensively. Tried the following https://docs.vmware.com/en/Unified-Access-Gateway/3.0/com.vmware.access-point-30-deploy-config.doc/GUID-870AF51F-AB37-4D6C-B9F5-4BFEB18F11E9.html to put .pem into a single line. Used awk 'NF {sub(/\r/, ""); printf "%s\n",$0;}' to achieve this, but now it threw "Invalid Certificate" response.
The following code works perfectly. The above awk command was replacing carriage returns with new line \n, but Cloudflare, apparently, wants the literal "\n".
code :
PRIVATE_KEY="/etc/letsencrypt/live/autoxxx.com.au/privkey.pem"

CERTIFICATE="/etc/letsencrypt/live/aautoxxx.com.au/cert.pem"

# read from file, put the .pem into single line and replace carriage returns with the literal "\n"
PRIVATE_KEY=`awk 'NF {sub(/\r/, ""); printf "%s\\\n",$0;}' $PRIVATE_KEY`
CERTIFICATE=`awk 'NF {sub(/\r/, ""); printf "%s\\\n",$0;}' $CERTIFICATE`

DATA='{"private_key":"'$PRIVATE_KEY'","certificate":"'$CERTIFICATE'","bundle_method":"ubiquitous"}' 

curl -i \
     -X PATCH "https://api.cloudflare.com/client/v4/zones/rCWR4i3A24NZEzI4dFLYLAhU7tUBtJUSYQkh/custom_certificates/iqXVG2FV8Cgj5FXGMexIoJovtFQx5UhecVya" \
     -H "X-Auth-Email: webdev@autoxxx.com.au" \
     -H "X-Auth-Key: pg5Q89JI33nsgdA9iZwPky3q" \
     -H "Content-Type: application/json" \
     -d "$DATA" --trace-ascii /dev/stdout


Share : facebook icon twitter icon
maven is "unable to find valid certification path to requested target" - letsencrypt ssl certificate

maven is "unable to find valid certification path to requested target" - letsencrypt ssl certificate


By : zhangdingquan
Date : March 29 2020, 07:55 AM
I hope this helps you . Finally figured it out, 3 months later...
The apache server in front of the maven artifactory repository was not configured to provide the intermediate certificate in the chain.
code :
  SSLEngine On
  SSLCertificateFile "path/to/domain.crt"
  SSLCertificateKeyFile "path/to/domain.key"
  SSLEngine On
  SSLCertificateFile "path/to/domain.crt"
  SSLCertificateKeyFile "path/to/domain.key"
  SSLCertificateChainFile "path/to/letsencrypt-authority-x3-identrust.pem"
Curl AWS api-gateway - {"message":"Forbidden"}curl: (3) <url> malformed

Curl AWS api-gateway - {"message":"Forbidden"}curl: (3) <url> malformed


By : ChL
Date : March 29 2020, 07:55 AM
I wish this help you @randomir pointed out that the other fields were being returned, not passed to the service. Also, I had to put curly braces around the -H values to get passed the {"message":"Forbidden"} error.
code :
curl -X POST  -H {"x-api-key: xxxxxxxx"} https://xxx.execute-api.eu-west-1.amazonaws.com/dev/screenshots?url=http://google.com/
Generating SSL certificate with letsencrypt fails with "300 - Multiple Choices"

Generating SSL certificate with letsencrypt fails with "300 - Multiple Choices"


By : user1689849
Date : March 29 2020, 07:55 AM
may help you . I found the solution. According to this this blog entry it is related to the DNS settings of the first domain mydomain.de which has a A-Record pointing to my server and an AAAA-Record (IPv6) pointing to a different location which caused the "Multiple choice" response which is in fact a response from the certbot/letsencrypt and is not related to traefik.
After removing the AAAA-Record from DNS certificate generations now seems to work.
Double encryption with Cloudflare SSL certificate + nginx letsencrypt certificate?

Double encryption with Cloudflare SSL certificate + nginx letsencrypt certificate?


By : Coden00b
Date : October 14 2020, 08:10 PM
help you fix your problem There is no double encryption in the form of two encryptions inside each other. Instead there is one encryption between browser and Cloudflare and another one between Cloudflare and nginx. Both Cloudflare and nginx have access to the plain (unencrypted) data. The browser will only see and validate the certificate from Cloudflare while Cloudflare will see and validate the certificate from LetsEncrypt (served from nginx).
Traefik: Simple Letsencrypt HTTPS redirect to whoami service throws "404 page not found"

Traefik: Simple Letsencrypt HTTPS redirect to whoami service throws "404 page not found"


By : Bex1977
Date : March 29 2020, 07:55 AM
To fix this issue You have to remove traefik.frontend.entryPoints (linked to defaultentrypoints) or use traefik.frontend.entryPoints=http,https
code :
version: "3"

services:
  reverse-proxy:
    image: traefik:v1.7.8
    command:
      - --logLevel=WARN
      - --defaultentrypoints=http,https
      - --entrypoints=Name:http Address::80 Redirect.EntryPoint:https
      - --entrypoints=Name:https Address::443 TLS
      - --acme
      - --acme.email=myemail@gmail.com
      - --acme.storage=acme.json
      - --acme.entryPoint=https
      - --acme.httpChallenge.entryPoint=http
      - --acme.OnHostRule=true
      - --acme.onDemand=false
      - --acme.acmeLogging=true
      - --docker
      - --docker.exposedbydefault=false
      - --docker.domain=some-example-domain.com
    restart: always
    networks:
      - web
    ports:
      - "80:80"     # The HTTP port
      - "443:443"   # The HTTPS port
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
      - /opt/data/traefik/acme.json:/acme.json
  whoami:
    image: containous/whoami  # A container that exposes an API to show its IP address
    labels:
      - "traefik.enable=true"
      - "traefik.frontend.rule=Host:some-example-domain.com"
    networks:
     - web

networks:
  web:
    external: true
shadow
Privacy Policy - Terms - Contact Us © bighow.org