- Newest
- Most votes
- Most comments
Hello, are you familiar with S3 presigned URLs? That is a way to generate a temporary URL that allows users with that URL to download an object. It is a good option for your use case. You create the URL with an expiration date and time then share it with the users who need it. For more information, see the documentation here
answered 4 years ago
If you don't need any authentication and just want to serve up the files from the S3 bucket without making the bucket or objects public, use a CloudFront distribution in front of the bucket. See: Amazon S3 + Amazon CloudFront: A Match Made in the Cloud.
Thanks, I will try it.
Dear Mr. Kentrad, I have created the CloudFront distribution in front of the bucket and i can access the files from my board. Now i would like more security. So i have created following this example : How to configure Cloudfront Presign URLs https://www.youtube.com/watch?v=NTOCzsn7b4A, a protected folder with the key. During the HTTPS connection i send the the url of the CloudFront bucket, the CA Root certificate to get the object in the non protected folder. My question is how can i access the file without a Presigned URL inside the protected folder? I have the following structure from ESP32:
/**
- @brief HTTP configuration
*/
typedef struct {
const char url; /!< HTTP URL, the information on the URL is most important, it overrides the other fields below, if any */
const char host; /!< Domain or IP as string /
int port; /!< Port to connect, default depend on esp_http_client_transport_t (80 or 443) */
const char username; /!< Using for Http authentication */
const char password; /!< Using for Http authentication /
esp_http_client_auth_type_t auth_type; /!< Http authentication type, see
esp_http_client_auth_type_t*/ const char path; /!< HTTP Path, if not set, default is/*/ const char query; /!< HTTP query */ const char cert_pem; /!< SSL server certification, PEM format as string, if the client requires to verify server / size_t cert_len; /!< Length of the buffer pointed to by cert_pem. May be 0 for null-terminated pem / const char client_cert_pem; /!< SSL client certification, PEM format as string, if the server requires to verify client / size_t client_cert_len; /!< Length of the buffer pointed to by client_cert_pem. May be 0 for null-terminated pem / const char client_key_pem; /!< SSL client key, PEM format as string, if the server requires to verify client / size_t client_key_len; /!< Length of the buffer pointed to by client_key_pem. May be 0 for null-terminated pem / const char client_key_password; /!< Client key decryption password string / size_t client_key_password_len; /!< String length of the password pointed to by client_key_password / const char user_agent; /!< The User Agent string to send with HTTP requests / esp_http_client_method_t method; /!< HTTP Method / int timeout_ms; /!< Network timeout in milliseconds / bool disable_auto_redirect; /!< Disable HTTP automatic redirects / int max_redirection_count; /!< Max number of redirections on receiving HTTP redirect status code, using default value if zero/ int max_authorization_retries; /!< Max connection retries on receiving HTTP unauthorized status code, using default value if zero. Disables authorization retry if -1/ http_event_handle_cb event_handler; /!< HTTP Event Handle / esp_http_client_transport_t transport_type; /!< HTTP transport type, seeesp_http_client_transport_t/ int buffer_size; /!< HTTP receive buffer size / int buffer_size_tx; /!< HTTP transmit buffer size */ void user_data; /!< HTTP user_data context / bool is_async; /!< Set asynchronous mode, only supported with HTTPS for now / bool use_global_ca_store; /!< Use a global ca_store for all the connections in which this bool is set. / bool skip_cert_common_name_check; /!< Skip any validation of server certificate CN field */ esp_err_t (*crt_bundle_attach)(void conf); /!< Function pointer to esp_crt_bundle_attach. Enables the use of certification bundle for server verification, must be enabled in menuconfig / bool keep_alive_enable; /!< Enable keep-alive timeout / int keep_alive_idle; /!< Keep-alive idle time. Default is 5 (second) / int keep_alive_interval; /!< Keep-alive interval time. Default is 5 (second) / int keep_alive_count; /!< Keep-alive packet retry send count. Default is 3 counts */ struct ifreq if_name; /!< The name of interface for data to go through. Use the default interface without setting */ } esp_http_client_config_t;
In the not protected folder i use : const char *url; const char *cert_pem;
Thanks.
answered 4 years ago
Relevant content
asked 4 years ago

Hi, thanks. Yes i am familiar with them. I have tried them and they work fine. The problem is that they are very long up to 1Kbyte or more. My communication method is a sim card, so i will consume a lot of bytes. I would like to know if the method described above is possible to work. The hole point is to keep the bucket private.