diff --git a/README.md b/README.md index 916fb70d..43632108 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![VFX Platform](https://img.shields.io/badge/vfxplatform-2020-blue.svg)](http://www.vfxplatform.com/) -[![Python 3.7](https://img.shields.io/badge/python-3.7-blue.svg)](https://www.python.org/) +[![VFX Platform](https://img.shields.io/badge/vfxplatform-2023%202022%202021%202020-blue.svg)](http://www.vfxplatform.com/) +[![Python 3.7 3.9 3.10](https://img.shields.io/badge/python-3.7%20%7C%203.9%20%7C%203.10-blue.svg)](https://www.python.org/) [![Reference Documentation](http://img.shields.io/badge/doc-reference-blue.svg)](http://developer.shotgridsoftware.com/python-api) [![Build Status](https://dev.azure.com/shotgun-ecosystem/Python%20API/_apis/build/status/shotgunsoftware.python-api?branchName=master)](https://dev.azure.com/shotgun-ecosystem/Python%20API/_build/latest?definitionId=108&branchName=master) [![Coverage Status](https://coveralls.io/repos/github/shotgunsoftware/python-api/badge.svg?branch=master)](https://coveralls.io/github/shotgunsoftware/python-api?branch=master) diff --git a/azure-pipelines-templates/run-tests.yml b/azure-pipelines-templates/run-tests.yml index 31782ef0..c075746e 100644 --- a/azure-pipelines-templates/run-tests.yml +++ b/azure-pipelines-templates/run-tests.yml @@ -43,11 +43,19 @@ jobs: # matrix. strategy: matrix: - # We support these two versions of Python. + # We support these versions of Python. Python37: python.version: '3.7' Python39: python.version: '3.9' + Python310: + python.version: '3.10' + # Note for Python 3.11. This will raise hundres of warnings on a third party module + # pytest_nunit/nunit.py + # DeprecationWarning: Use setlocale(), getencoding() and getlocale() instead + # This is the current behavior on the latest 1.0.3 version of this module. + + maxParallel: 3 # These are the steps that will be executed inside each job. steps: diff --git a/shotgun_api3/shotgun.py b/shotgun_api3/shotgun.py index 00087a5a..7d20906e 100644 --- a/shotgun_api3/shotgun.py +++ b/shotgun_api3/shotgun.py @@ -4244,11 +4244,19 @@ def connect(self): "Connect to a host on a given (SSL) port." http_client.HTTPConnection.connect(self) # Now that the regular HTTP socket has been created, wrap it with our SSL certs. - self.sock = ssl.wrap_socket( - self.sock, - ca_certs=self.__ca_certs, - cert_reqs=ssl.CERT_REQUIRED - ) + if six.PY38: + context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) + context.verify_mode = ssl.CERT_REQUIRED + context.check_hostname = False + if self.__ca_certs: + context.load_verify_locations(self.__ca_certs) + self.sock = context.wrap_socket(self.sock) + else: + self.sock = ssl.wrap_socket( + self.sock, + ca_certs=self.__ca_certs, + cert_reqs=ssl.CERT_REQUIRED + ) class CACertsHTTPSHandler(urllib.request.HTTPSHandler):