user3668129
user3668129

Reputation: 4820

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

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 ?

Upvotes: 9

Views: 11069

Answers (2)

Brian Sidebotham
Brian Sidebotham

Reputation: 1906

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.

Upvotes: 15

SBylemans
SBylemans

Reputation: 1764

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

Upvotes: 4

Related Questions