Juan Pablo B
Juan Pablo B

Reputation: 515

Minio TLS certificate signed by unknown authority

I have an applicaiton with docker, nginx and minio and I added mkcert certificates to run https locally and it works but when I want to connect to minio container I get:

mc: Unable to initialize new alias from the provided credentials. Get "https://finaldraw.local:9001": tls: failed to verify certificate: x509: certificate signed by unknown authority.

The certs are generated with:

mkcert -cert-file ./config/certs/public.crt -key-file ./config/certs/private.key finaldraw.local "*.finaldraw.local" localhost 127.0.0.1 ::1

keys generated in the project:

and to set the alias I run:

docker exec -it findra-minio mc alias set finaldraw https://finaldraw.local:$(FORWARD_MINIO_PORT) $(MINIO_ROOT_USER) $(MINIO_ROOT_PASSWORD)

Minio service:

Minio service:

  # Minio storage service
  findra-minio:
    container_name: findra-minio
    image: minio/minio
    hostname: finaldraw.local
    command: server --certs-dir /root/.minio/certs --console-address ":${FORWARD_MINIO_CONSOLE_PORT:-9002}" --address ":${FORWARD_MINIO_PORT:-9001}" /data 
    ports:
      - '${FORWARD_MINIO_PORT:-9001}:9001'
      - '${FORWARD_MINIO_API_PORT:-9002}:9002'
    environment:
      MINIO_ROOT_USER: ${MINIO_ROOT_USER}
      MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
      MINIO_SERVER_URL: "https://finaldraw.local"
    healthcheck:
      test: timeout 5s bash -c ':> /dev/tcp/finaldraw.local/9001' || exit 1
      interval: 30s
      timeout: 10s
      retries: 5
    volumes:
      - type: volume
        source: findra_minio
        target: /data
      - type: bind
        source: ./config/certs
        target: /root/.minio/certs
    networks:
      - backend

In nginx I have 2 config file, one for 80 port an another for port 433 and this is working fine. (I don't have any location in nginx for minio)

Upvotes: 0

Views: 433

Answers (0)

Related Questions