Getting '[SSL: WRONG_VERSION_NUMBER] wrong version number when working with minio?
Asked Answered
D

2

8

I installed local minio storage:

wget https://dl.min.io/server/minio/release/linux-amd64/minio
chmod +x minio
./minio server /home/myuser/minio_storage --console-address ":5050"

I'm trying to connect and create new bucket:

    client = Minio("127.0.0.1:5050")        
    found = client.bucket_exists("my_bucket")
    if not found:
        client.make_bucket("my_bucket")
    else:
        print("Bucket 'my_bucket' already exists")

And I'm getting error:

raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='127.0.0.1', port=5050): Max retries exceeded with url: /my_buket (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:852)'

What do I need to do in order to create new bucket ?

Debility answered 15/2, 2022 at 8:55 Comment(0)
B
13

You've started the minio service without TLS enabled and so the service is running on the HTTP protocol on port 5050.

You therefore need to tell the client to connect using HTTP also by using the secure=False option as documented

client = Minio("127.0.0.1:5050", secure=False)

Or configure the server to be running with TLS which is the better option which is also documented.

Brainsick answered 8/6, 2022 at 12:40 Comment(0)
S
4

I had the same problem and adding secure=False to the constructor of the minio client fixed it for me.

Sunflower answered 8/6, 2022 at 12:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.