How to get Storj-hosted S3 Compatible Gateway URL after uploading files to bucket?

Hello,

I have uploaded image into storj bucket using put object on gateway of storjshare io its was uploaded successfully.

var s3FileBase = new S3({
endpoint: “”,
region: “us-east-1”,
credentials: {
accessKeyId: “xxxx”,
secretAccessKey: “xxxx”,
},
signatureVersion: “v4”,
});

while trying to access uploaded image in browser using following gateway urls its showing AccessDenied error in browser .

urls : https://gateway.storjshare.io/bucketname/xxxxxxxx.png
urls : https://bucketname.gateway.storjshare.io/xxxxxxxx.png

Error Message

AccessDenied

Access Denied.

xxxxxx.png

test

/xxxxxx.png

17154246F37E5230

Let us know how to access the Image in Https using gateway url ?

The S3-Compatible Gateway doesn’t support globally public buckets, you should use either:

1 Like

S3-Compatible Gateway doesn’t support globally public buckets
You mean, Only Storj-hosted Gateway doesn’t support globally public buckets ?

if we host Self-hosted S3-Compatible Gateway on server would we able to access in browser ?

https://[storjbucketname].[selfhostgateway]/[filename.png] to storj

Yes. You will need to publish your gateway via reverse-proxy with https support and can have an access to objects.
Because by default your files will be accessible only like http://localhost:7777/bucket/image.png
You need to run it in website mode: Gateway ST Advanced Usage | Storj Docs

2 Likes

Hosted self-hosted s3 compatible on server via revers-proxy with https support. Everything working fine as expected. Faced some issue on put object.

UnknownEndpoint: Inaccessible host: demo.s3.domain.com'. This service may not be available in the us-east-1’ region.

bucket name : demo

End Point URL

  • Storj-hosted URL
    if am using Storj-hosted s3 endpoint endpoint: “https://gateway.storjshare.io put object is working fine.

  • Self-Hosted URL
    if am using Self-hosted s3 endpoint endpoint: “https://s3.domain.com put object return error UnknownEndpoint: Inaccessible host. Automatically appending bucket name in front of domain like https://[bucketname].s3.domain.com So added A record [bucketname].s3 in domain provider.

Now facing issue like

Error: write EPROTO 140252113790784:error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure:…/deps/openssl/openssl/ssl/record/rec_layer_s3.c:1407:SSL alert number 40

at WriteWrap.afterWrite [as oncomplete] (net.js:779:14)

message:
‘write EPROTO 140252113790784:error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure:…/deps/openssl/openssl/ssl/record/rec_layer_s3.c:1407:SSL alert number 40\n’,
errno: ‘EPROTO’,
code: ‘NetworkingError’,
syscall: ‘write’,
region: ‘us-east-1’,

How to resolve the Handshake failure issue ?

Can you clarify what you’re trying to do with the urls?

Are you trying to host the image on your own website?

Uploading Images to storj and get the images. Its for photo storage. if am using https://gateway.storjshare.io/ gateway its taking more than 10 seconds for 5mb file. So, try to use self-hosted gateway while uploading facing the above problem.

If you access your gateway domain in the browser, does it show some TLS errors? The error looks like some problem with the certificate.

Searching for that error, it looks like it can happen if the server doesn’t know how to handle the host in the request: Nginx reverse proxy error: SSL alert number 40 while SSL handshaking to upstream server (SSL server name)