We are using docker compose to setup MinIO service, now we are adding the SSL security.
Login screen displays without problem on https://my.domain:9001
but it fails on login attempt.
When env variable MINIO_SERVER_URL
is left out, the error says Post "https://SOME_IP_ADDRESS:9000/": x509: cannot validate certificate for SOME_IP_ADDRESS because it doesn't contain any IP SANs
.
When MINIO_SERVER_URL=https://my.domain:9000
or MINIO_SERVER_URL=https://my.domain:9001
the error becomes Post "https://my.domain:9000/": dial tcp SERVER_IP_ADDRESS:9000: connect: connection refused
.
Before implementing SSL it worked on SERVER_IP_ADDRESS:9001 which becomes unavailable after setting cert volumes in docker-compose.yml
From browser network dev tools the response number is 500 with message "invalid login" regardless credentials being correct or not.
MinIO buckets are accessible from other services.
version: "3.9"
services:
minio:
image: minio/minio:latest
command: server --console-address ":9001" /data
container_name: minio
ports:
- "9000:9000"
- "9001:9001"
environment:
- MINIO_ROOT_USER=${ADMIN_USERNAME}
- MINIO_ROOT_PASSWORD=${ADMIN_PASSWORD}
- MINIO_SERVER_URL=https://my.domain:9000
volumes:
- ./data_docker/raw:/data
- ${PATH_CERT_FILE}:/root/.minio/certs/public.crt:ro
- ${PATH_CERT_PRIVATE_KEY}:/root/.minio/certs/private.key:ro
healthcheck:
test: ["CMD", "curl", "-f", "https://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
restart: always
Any tips how to solve this error?
2
Answers
This was solved by adding
hostname:
to specify domainI believe your best bet is to set hosts since minio itself doesn’t know about "my.domain" which is required to access minio over ssl.
This can be done with adding following to docker-compose