docker_auth icon indicating copy to clipboard operation
docker_auth copied to clipboard

Failing to parse private key

Open SeanOMik opened this issue 3 years ago • 0 comments

I'm getting an error when I try to start a docker_auth docker container:

Failed to load config: failed to load server cert and key: tls: failed to parse private key

This is my docker_auth configuration:

server:
  addr: ":5001"
  certificate: "/cert/cert.pem"
  key: "/cert/key.pem"

token:
  issuer: "Acme auth server"  # Must match issuer in the Registry config.
  expiration: 900

users:
  # Password is specified as a BCrypt hash. Use `htpasswd -nB USERNAME` to generate.
  "seanomik":
    password: "REDACTED"

acl:
  - match: {account: "seanomik"}
    actions: ["*"]
    comment: "Has full access to everything."
  - match: {account: "/.+/"}
    actions: ["push", "pull"]
    comment: "Logged in users can push and pull."
  - match: {account: ""}
    actions: ["pull"]
    comment: "Anonymous users can only pull."

And this is the docker-compose:

version: "3.5"

services:
  auth:
    image: cesanta/docker_auth:1
    ports:
      - 5001:5001
    volumes:
      - ./auth_config.yml:/config/auth_config.yml:ro
      - ./logs/auth:/logs

      - ./cert:/cert
    command: --v=2 --alsologtostderr /config/auth_config.yml

The .cert directory has key.pem and cert.pem which I generated with this openssl command:

openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 365

SeanOMik avatar Nov 05 '22 00:11 SeanOMik