Skip to content
New issue

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

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

Already on GitHub? # to your account

SSH-Helper supported in China Region #69

Closed
DongZhaoXiong opened this issue Jan 1, 2025 · 1 comment
Closed

SSH-Helper supported in China Region #69

DongZhaoXiong opened this issue Jan 1, 2025 · 1 comment
Assignees

Comments

@DongZhaoXiong
Copy link

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

@ivan-khvostishkov ivan-khvostishkov self-assigned this Jan 31, 2025
@ivan-khvostishkov
Copy link
Contributor

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

No branches or pull requests

2 participants