Putting object to Spaces with Access Key gives cert error

I get this error

x509: certificate signed by unknown authority

when I try to put an object to Spaces using access keys in a docker container. I can get files just fine, and I can put files from my local machine (not in a docker container). I’m using the minio package from a golang app. This happens even with ssl=false. Is it looking for a cert only on puts?

Here’s what my code looks like

	endpoint := ""
	bucket := "mybucket"
	ssl := false
	client, err := minio.New(endpoint, accessKey, secKey, ssl)
	if err != nil {
		return nil
	//this get works fine
	obj, err := client.GetObject(bucket, fileName, minio.GetObjectOptions{})
	if err != nil {
		return nil
	reader := bytes.NewReader(contents)
	//this put fails
	_, err = client.PutObject(bucket, "test.jpeg", reader, reader.Size(), minio.PutObjectOptions{})
	if err != nil {
		fmt.Println(err)	//this is where I get the error

Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
May 11, 2022

Hi there,

There has been a similar problem reported here:

The suggested solution was to update your CA certificates as described here:

And also try to update your packages too just in case.

Let me know how it goes.