KeepLearn
KeepLearn

Reputation: 308

Transfer data from aws s3 to gcs by using gsutil - SSL Certification Error

I am trying to transfer data from AWS S3 to GCS. I changed the private key and secrete key in boto file and when I try the following command getting the error.

Command: gsutil ls s3://axz

Error Message:

Traceback (most recent call last): File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform/gsutil\gsutil", line 22, in gsutil.RunMain() File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gsutil.py", line 114, in RunMain sys.exit(gslib.main.main()) File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib__main__.py", line 383, in main perf_trace_token=perf_trace_token) File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib__main__.py", line 577, in _RunNamedCommandAndHandleExceptions collect_analytics=True) File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\command_runner.py", line 299, in RunNamedCommand return_code = command_inst.RunCommand() File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\commands\ls.py", line 526, in RunCommand exp_dirs, exp_objs, exp_bytes = ls_helper.ExpandUrlAndPrint(storage_url) File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\ls_helper.py", line 180, in ExpandUrlAndPrint print_initial_newline=False) File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\ls_helper.py", line 252, in _RecurseExpandUrlAndPrint bucket_listing_fields=self.bucket_listing_fields): File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\wildcard_iterator.py", line 476, in IterAll expand_top_level_buckets=expand_top_level_buckets): File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\wildcard_iterator.py", line 157, in iter fields=bucket_listing_fields): File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\gslib\boto_translation.py", line 380, in ListObjects for key in objects_iter: File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\third_party\boto\boto\s3\bucketlistresultset.py", line 34, in bucket_lister encoding_type=encoding_type) File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\third_party\boto\boto\s3\bucket.py", line 473, in get_all_keys '', headers, params) File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\third_party\boto\boto\s3\bucket.py", line 399, in _get_all query_args=query_args) File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\third_party\boto\boto\s3\connection.py", line 668, in make_request retry_handler=retry_handler File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\third_party\boto\boto\connection.py", line 1071, in make_request retry_handler=retry_handler) File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\gsutil\third_party\boto\boto\connection.py", line 1030, in _mexe raise ex **ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)

Upvotes: 1

Views: 675

Answers (1)

mhouglum
mhouglum

Reputation: 2593

This likely comes from a difference between the SSL certificate bundles on your machines - that's generally been the issue for others that have encountered this error, e.g. https://github.com/aws/aws-cli/issues/1545

If you're unable to update your certificate bundle, you might also try explicitly disabling certificate validation (be warned, this opens you up for man-in-the-middle attacks) by setting the https_validate_certificates Boto option:

gsutil -o 'Boto:https_validate_certificates=False' [...]


Edit:
You might also want to try generating your own certificate bundle file via
https://github.com/curl/curl/blob/master/lib/mk-ca-bundle.pl
and seeing if making gsutil use that will help:

gsutil -o 'Boto:ca_certificates_file=C:\path\to\ca-bundle.crt' [...]

Upvotes: 1

Related Questions