2

I am using the below code in python for sending request

def get(self, url):
 response = None
 try:
    ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1_1 | ssl.PROTOCOL_TLSv1_2)
    if url.lower().startswith('https'):
        response = ur.urlopen(url, context=ctx)
        return response.read()
    else:
        raise ValueError from None
 except Exception as ex:
    print(str(ex))

I am getting error when performing code quality test using bandit enter image description here

User123
  • 793
  • 4
  • 10
  • 28

0 Answers0