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

httplib patcher: False identifying outoing HTTPS requests as HTTP #121

Closed
chanchiem opened this issue Jan 18, 2019 · 1 comment
Closed
Assignees
Labels

Comments

@chanchiem
Copy link
Contributor

chanchiem commented Jan 18, 2019

Currently, X-Ray detects outgoing HTTP/HTTPS requests made through the urllib httplib client automatically get identified as HTTP. The issue is that the underlying check in the patcher is no longer valid:
https://github.com/aws/aws-xray-sdk-python/blob/master/aws_xray_sdk/ext/httplib/patch.py#L95

The SSLContext name of a https connection instance varies depending on if the underlying request instance is utilizing urllib's VerifiedHTTPSConnection or httplib's HTTPSConnection object. For the former, ssl_context is the variable name for its SSLContext, where as _context is the variable name for the latter's SSLContext

The overall effect on this misidentification causes other libraries such as Requests and Botocore which utilize urllib to also misidentify their http/https url endpoints during metadata capture.

@chanchiem chanchiem changed the title httplib patcher: Detecting HTTPS as HTTP httplib patcher: False identifying outoing HTTPS requests as HTTP Jan 18, 2019
@chanchiem chanchiem self-assigned this Jan 18, 2019
@chanchiem chanchiem added the bug label Jan 18, 2019
chanchiem added a commit to chanchiem/aws-xray-sdk-python that referenced this issue Jan 18, 2019
    * Libraries utilizing urllib3 now properly get matched as https when an https request is made.
        + botocore and requests utilize urllib3, so any underlying https request now properly
          identifies as https.
chanchiem added a commit to chanchiem/aws-xray-sdk-python that referenced this issue Jan 18, 2019
    * Libraries utilizing urllib3 now properly get matched as https when an https request is made.
        + botocore and requests utilize urllib3, so any underlying https request now properly
          identifies as https.
chanchiem added a commit to chanchiem/aws-xray-sdk-python that referenced this issue Jan 18, 2019
    * Libraries utilizing urllib3 now properly get matched as https when an https request is made.
        + botocore and requests utilize urllib3, so any underlying https request now properly
          identifies as https.
haotianw465 pushed a commit that referenced this issue Jan 18, 2019
* Libraries utilizing urllib3 now properly get matched as https when an https request is made.
        + botocore and requests utilize urllib3, so any underlying https request now properly
          identifies as https.
@chanchiem
Copy link
Contributor Author

Fixed through PR #122

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant