How to reslove "Failed to create connection to S3 bucket" error

I have been able to use this code to read files in media set in code repository in the public foundry:

with control_file_input.get_media_item(item.mediaItemRid) as stream:

                xml_bytes = stream.read()

In recent several days, the code will generate error message at the 2nd line: Failed to create connection to host host='pcloud-mio-REDACTED.s3.us-east-1.amazonaws.com', port=443

Can I adjust my settings in some way to solve this error?