Skip to content

SSH-Helper supported in China Region #69

@DongZhaoXiong

Description

@DongZhaoXiong

Problem Description

I use the ssh-helper, encounter error:

File ~/anaconda3/envs/python3/lib/python3.10/site-packages/urllib3/connection.py:199, in HTTPConnection._new_conn(self)
    198 try:
--> 199     sock = connection.create_connection(
    200         (self._dns_host, self.port),
    201         self.timeout,
    202         source_address=self.source_address,
    203         socket_options=self.socket_options,
    204     )
    205 except socket.gaierror as e:

File ~/anaconda3/envs/python3/lib/python3.10/site-packages/urllib3/util/connection.py:60, in create_connection(address, timeout, source_address, socket_options)
     58     raise LocationParseError(f"'{host}', label empty or too long") from None
---> 60 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
     61     af, socktype, proto, canonname, sa = res

File ~/anaconda3/envs/python3/lib/python3.10/socket.py:967, in getaddrinfo(host, port, family, type, proto, flags)
    966 addrlist = []
--> 967 for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
    968     af, socktype, proto, canonname, sa = res

gaierror: [Errno -2] Name or service not known

The above exception was the direct cause of the following exception:
...
    495     raise ProxyConnectionError(
    496         proxy_url=mask_proxy_url(proxy_url), error=e
    497     )

EndpointConnectionError: Could not connect to the endpoint URL: "https://sts.cn-north-1.amazonaws.com/"

I checked the wrapper.py line 77 and found the cause:

endpoint_url = "https://sts.{}.amazonaws.com".format(region)
caller_id = boto3.client("sts", region_name=region, endpoint_url=endpoint_url).get_caller_identity()

But the STS endpoint url in China region is:
https://sts.{}.amazonaws.com.cn

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions