Skip to content

Commit 1be45af

Browse files
authored
Bring back S3_VERIFY_SSL environment variable (#1790)
1 parent 3965bf2 commit 1be45af

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

tensorflow_io/core/filesystems/s3/s3_filesystem.cc

+7
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,13 @@ static Aws::Client::ClientConfiguration& GetDefaultClientConfig() {
134134
absl::MutexLock l(&cfg_lock);
135135

136136
if (!init) {
137+
const char* verify_ssl = getenv("S3_VERIFY_SSL");
138+
if (verify_ssl) {
139+
if (verify_ssl[0] == '0')
140+
cfg.verifySSL = false;
141+
else
142+
cfg.verifySSL = true;
143+
}
137144
// if these timeouts are low, you may see an error when
138145
// uploading/downloading large files: Unable to connect to endpoint
139146
int64_t timeout;

tests/test_s3.py

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def test_read_file():
5151
response = client.get_object(Bucket=bucket_name, Key=key_name)
5252
assert response["Body"].read() == body
5353

54+
os.environ["S3_VERIFY_SSL"] = "0"
5455
os.environ["S3_ENDPOINT"] = "http://localhost:4566"
5556

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

0 commit comments

Comments
 (0)