Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring back S3_VERIFY_SSL environment variable #1790

Merged
merged 1 commit into from
May 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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