Skip to content

Failing to parse private key #353

@SeanOMik

Description

@SeanOMik

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions