Skip to content

Commit

Permalink
Bring back S3_VERIFY_SSL environment variable (#1790)
Browse files Browse the repository at this point in the history
  • Loading branch information
fsonntag authored May 8, 2023
1 parent 3965bf2 commit 1be45af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tensorflow_io/core/filesystems/s3/s3_filesystem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ static Aws::Client::ClientConfiguration& GetDefaultClientConfig() {
absl::MutexLock l(&cfg_lock);

if (!init) {
const char* verify_ssl = getenv("S3_VERIFY_SSL");
if (verify_ssl) {
if (verify_ssl[0] == '0')
cfg.verifySSL = false;
else
cfg.verifySSL = true;
}
// if these timeouts are low, you may see an error when
// uploading/downloading large files: Unable to connect to endpoint
int64_t timeout;
Expand Down
1 change: 1 addition & 0 deletions tests/test_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def test_read_file():
response = client.get_object(Bucket=bucket_name, Key=key_name)
assert response["Body"].read() == body

os.environ["S3_VERIFY_SSL"] = "0"
os.environ["S3_ENDPOINT"] = "http://localhost:4566"

content = tf.io.read_file(f"s3://{bucket_name}/{key_name}")
Expand Down

0 comments on commit 1be45af

Please sign in to comment.