bnb-chain / greenfield-cmd

support cmd tool for Greenfield
GNU Lesser General Public License v3.0
28 stars 12 forks source link

Failed to verify certificate x509 #123

Closed urataps closed 3 weeks ago

urataps commented 2 months ago

Hi, I'm trying to follow the Basic File Management tutorial from greenfield docs, and I get the invalid x509 certificate whenever I try to put a file, I get a successful transaction but also the following error

My command:

gnfd-cmd object put --contentType "text/plain" ./key.txt gnfd://barabulabucket/barabula.txt

Result:

object barabula.txt created on chain
transaction hash:  C7469036C240CC741545C8A6F3375C31A4AA6245929AAC8F287344F401C33659
{"level":"error","time":"2024-08-13T11:27:23+03:00","message":"do API error, url: https://barabulabucket.gnfd-testnet-sp.epotter-qa.io/barabula.txt?upload-progress=, err: Get \"https://barabulabucket.gnfd-testnet-sp.epotter-qa.io/barabula.txt?upload-progress=\": tls: failed to verify certificate: x509: certificate is valid for *.epotter-qa.io, epotter-qa.io, not barabulabucket.gnfd-testnet-sp.epotter-qa.io"}
{"level":"error","time":"2024-08-13T11:27:24+03:00","message":"do API error, url: https://barabulabucket.gnfd-testnet-sp.epotter-qa.io/barabula.txt, err: Put \"https://barabulabucket.gnfd-testnet-sp.epotter-qa.io/barabula.txt\": tls: failed to verify certificate: x509: certificate is valid for *.epotter-qa.io, epotter-qa.io, not barabulabucket.gnfd-testnet-sp.epotter-qa.io"}
run command error: Put "https://barabulabucket.gnfd-testnet-sp.epotter-qa.io/barabula.txt": tls: failed to verify certificate: x509: certificate is valid for *.epotter-qa.io, epotter-qa.io, not barabulabucket.gnfd-testnet-sp.epotter-qa.io

However the real problem is when I try to get this file like this

gnfd-cmd object get gnfd://barabulabucket/barabula.txt barabula.txt

Because I'm getting the same certificate error and no file is written after the command.

{"level":"error","time":"2024-08-13T11:28:31+03:00","message":"do API error, url: https://barabulabucket.gnfd-testnet-sp.epotter-qa.io/barabula.txt, err: Get \"https://barabulabucket.gnfd-testnet-sp.epotter-qa.io/barabula.txt\": tls: failed to verify certificate: x509: certificate is valid for *.epotter-qa.io, epotter-qa.io, not barabulabucket.gnfd-testnet-sp.epotter-qa.io"}
run command error: Get "https://barabulabucket.gnfd-testnet-sp.epotter-qa.io/barabula.txt": tls: failed to verify certificate: x509: certificate is valid for *.epotter-qa.io, epotter-qa.io, not barabulabucket.gnfd-testnet-sp.epotter-qa.io

I get however a hidden file called .barabula.txt.tmp but it's empty

Any idea why this happens and how to solve the issue?

I have Ubuntu 22, and gnfd v1.0.2 built from source at the tag at v1.6.0 with go 1.21.6.

urataps commented 2 months ago

Note: switching the storage providers solved the issue, so there was a problem with that SP

STdevK commented 2 months ago

Thank you sharing the solution