botocore.exceptions.SSLError: SSL validation failed on WIndows

吃可爱长大的小学妹 提交于 2020-12-13 04:23:06

问题


The below code is for getting the regions.

import boto3
ec2 = boto3.client('ec2', 'region-name')
print(ec2.describe_regions())

On executing this code on my machine, I'm getting this error.

botocore.exceptions.SSLError: SSL validation failed for https://ec2.region-name.amazonaws.com/ [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)

I am running this code on Windows 10 machine with VS code as my editor. I looked for other answers where they required to install Install Certificates.command file. However, looks like it is found on macOS only.

Can someone tell me the reason for this issue as well?

Also, last week got a notification from AWS that they are updating all their AWS FIPS endpoints to TLS 1.2 and hence need to connect to TLS version 1.2 FIPS endpoints. I checked my TLS version here. It says I have TLS version 1.2. Is there anything related to this? Because prior to this notification, my script was running perfectly.

Please someone tell the reason for this error and possible correction. Also, correct me if I mentioned something wrong with my understanding.


回答1:


This question has already been answered on Stack Overflow before.

Try out the following solutions:

  • Reset AWS Credentials using AWS Configure
  • Issue Due to Fiddler
  • Reset HTTP/HTTPS Proxy Related Environment Variables
  • Reinstall and Upgrade AWS CLI
  • Using AWS_CA_BUNDLE Environment Variable
  • Moving CA Certificate PEM File in the Right Folder
  • Verifying CA Certificate
  • Install certifi Python Module
  • Install pyopenssl Python Module
  • Adding Trusted Root CA Details
  • Adding Trusted Host
  • Fixing the Version of requests and urllib3 Python Modules
  • Fixing CA Certificate Content and Location

Note: There is a solution related to disabling the SSL verification but that is not recommended.



来源:https://stackoverflow.com/questions/63557500/botocore-exceptions-sslerror-ssl-validation-failed-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!