Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent SSLError Handling #14

Open
tucked opened this issue Mar 27, 2019 · 1 comment
Open

Inconsistent SSLError Handling #14

tucked opened this issue Mar 27, 2019 · 1 comment
Labels
Bug_SDK Bugs related to SDK and surrounding scripts Packaging To Track the bug that are release mechanics and packaging specific

Comments

@tucked
Copy link
Member

tucked commented Mar 27, 2019

The SDK claims support for urllib3 >= 1.15:

REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"]

In urllib3 1.22, MaxRetryError is raised instead of SSLError directly:

Made the connection pool retry on SSLError. The original SSLError is available on MaxRetryError.reason. (Issue #1112)

This means that if urllib3 >= 1.22 is used, this code is bypassed:

except urllib3.exceptions.SSLError as e:
msg = "{0}\n{1}".format(type(e).__name__, str(e))
raise ApiException(status=0, reason=msg)

  1. That means urllib3.exceptions.MaxRetryError is exposed directly to the caller (even though the use of urllib3 is an implementation detail).
  2. The bypassed code discards the original exception which means that the caller must parse the ApiException.reason string to figure out what happened. In a way, this makes 1 preferable.
@tucked
Copy link
Member Author

tucked commented Mar 27, 2019

Also,

urllib3 does not have backward-compatibility guarantees on minor releases

So, pinning urllib3 to a compatible patch release (e.g. urllib3 ~= 1.15.1) is probably advisable.

@vboddui vboddui added Bug_SDK Bugs related to SDK and surrounding scripts Packaging To Track the bug that are release mechanics and packaging specific labels Apr 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug_SDK Bugs related to SDK and surrounding scripts Packaging To Track the bug that are release mechanics and packaging specific
Projects
None yet
Development

No branches or pull requests

2 participants