Repository: getsentry/sentry-python

Issue:
Cannot import appengine
### How do you use Sentry?

Sentry Saas (sentry.io)

### Version

1.18.0

### Steps to Reproduce

Install the SDK within any project that is not pinning urllib3 < 2.0.0

### Expected Result

ability to import appengine

### Actual Result

Cannot import appengine as gaecontrib.
As per urllib 2.0.0 release: https://github.com/urllib3/urllib3/tree/2.0.0

Removed urllib3.contrib.appengine.AppEngineManager and support for Google App Engine Standard Environment (https://github.com/urllib3/urllib3/issues/2044).


Discussion:
Hey @firaskafri !

Thanks for reporting this. Can you post the error with stacktrace you get in your project when you try to import appengine?
`sentry-sdk` should probably support  `urllib3 2.0.0` https://github.com/psf/requests/issues/6432 or fix the [dependencies](https://github.com/getsentry/sentry-python/blob/master/setup.py#L40-L44) 
Hello! As one of the urllib3 maintainers, I'd be happy to help, but so far we have no idea what the issue is, which is why an actual error with a traceback would be nice, as it would help understand where the issue is. (I don't think sentry-python imports `urllib3.contrib.appengine` itself?)
Thanks @pquentin, I came here because in AWS Lamdba I got:

```
[ERROR] Runtime.ImportModuleError: Unable to import module 'step_function_trigger': urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with OpenSSL 1.0.2k-fips  26 Jan 2017. See: https://github.com/urllib3/urllib3/issues/2168
Traceback (most recent call last):
```

It might or might not be related. But I notice that the link in the error is sending directly to you ;) 
Thanks! Note that this is different from the App Engine issue above. (And it has nothing to do with sentry-python.) It is a known issue with Amazon Linux 2 ([the default AWS Lambda distribution](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)) that is using OpenSSL 1.0.2, a version that has [not been supported by the OpenSSL project for 3+ years now](https://endoflife.date/openssl). My understanding is that Amazon Linux 2 is applying RHEL 7 patches to keep this version secure.

Anyway, I believe you have the following options:

 1. Pin urllib3 to <2.0 (we will continue supporting 1.26.x for now)
 2. Upgrade to Python 3.9 or above, where AWS Lambda runtimes come with OpenSSL 1.1.1
 3. Switch to a [custom Docker image](https://aws.amazon.com/blogs/aws/new-for-aws-lambda-container-image-support/) with OpenSSL 1.1.1+ support
urllib3 contributor @illia-v was surprised by the above statement, since Python 3.10 requires OpenSSL 1.1.1. They kindly checked the OpenSSL versions in AWS Lambda, with the following results:

 * Python 3.9 and 3.10 – OpenSSL 1.1.1t  7 Feb 2023
 * Python 3.7 and 3.8 – OpenSSL 1.0.2k-fips  26 Jan 2017

Good news! The best fix here is actually to upgrade your runtime to Python 3.9+. I've edited my comment above.

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -41,6 +41,7 @@ def get_file_text(file_name):
         'urllib3>=1.25.7; python_version<="3.4"',
         'urllib3>=1.26.9; python_version=="3.5"',
         'urllib3>=1.26.11; python_version >="3.6"',
+        'urllib3<2.0.0',
         "certifi",
     ],
     extras_require={


Test patch: