Skip to content

No "host" field in HTTP header in https proxy session #1981

Closed

Description

@0weight

With the assumption, the https connection with proxy has a session to use "CONNECT" method.
"CONNECT" method is available in http since version 1.1.

(https://tools.ietf.org/html/rfc7231#section-4)

However, in botocore, the https connection with "CONNECT" use HTTP/1.0
This problem is caused by Python's standard library
(the pull and request are already sent to github: python/cpython#8305)
In addion to that, there is no "Host" field in https session in Botocore in spite of the description in RFC7230 that "Host" field is required in HTTP/1.1.

A client MUST send a Host header field in all HTTP/1.1 request messages.

It causes the failure of proxy routing.

Activity

  1. changed the title [-]No "host" field in HTTP header in https session[/-] [+]No "host" field in HTTP header in https proxy session[/+] on Feb 23, 2020
  2. self-assigned this
    on Feb 24, 2020
  3. 0weight commented on Apr 13, 2020

    @0weight
    Author

    Hi @swetashre .
    I've actually tried it with the AWS CLI, so you can see it.

    This screenshot is the result of a packet capture of the aws s3 ls command.
    noHostHeader

    And this screenshot is another CONNECT METHOD packet capture.
    HostHeader

    The host field must be included like this.

    Some proxy servers use a "host field" for proxy-to-proxy forwarding on multiple proxies, which causes proxy-to-proxy forwarding to fail.

    Therefore, AWS CLI is not available in this environment.

  4. removed their assignment
    on Mar 25, 2021
  5. stobrien89 commented on May 18, 2021

    @stobrien89

    Hi @siradori,

    My apologies for the lack of response on this. Thanks for bringing it to our attention! This was reported to us in #2846 (boto3) as well— I think this is a more appropriate place to track it, given the shared functionality between the CLI and Boto3.

    There were some concerns about about race conditions in multi-threaded environments where the wrong host header may be sent, with regard to the current methods available to resolve this using urllib3, but I'll see if I can get the team's thoughts on your PR.

  6. github-actions commented on May 18, 2022

    @github-actions

    Greetings! It looks like this issue hasn’t been active in longer than one year. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions