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

macos: SSL validation failed for https://sts.amazonaws.com/ [Errno 2] No such file or directory #202

Open
Ganesh-Ponipireddy opened this issue Nov 29, 2022 · 1 comment

Comments

@Ganesh-Ponipireddy
Copy link

Ganesh-Ponipireddy commented Nov 29, 2022

Describe the bug
Describe the bug
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/urllib3/util/ssl_.py", line 402, in ssl_wrap_socket
context.load_verify_locations(ca_certs, ca_cert_dir, ca_cert_data)
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/botocore/httpsession.py", line 455, in send
urllib_response = conn.urlopen(
File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 787, in urlopen
retries = retries.increment(
File "/usr/local/lib/python3.10/site-packages/urllib3/util/retry.py", line 525, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/usr/local/lib/python3.10/site-packages/urllib3/packages/six.py", line 770, in reraise
raise value
File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 386, in _make_request
self._validate_conn(conn)
File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1042, in validate_conn
conn.connect()
File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 414, in connect
self.sock = ssl_wrap_socket(
File "/usr/local/lib/python3.10/site-packages/urllib3/util/ssl.py", line 404, in ssl_wrap_socket
raise SSLError(e)
urllib3.exceptions.SSLError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/okta-awscli", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1130, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/oktaawscli/okta_awscli.py", line 136, in main
if force or not aws_auth.check_sts_token():
File "/usr/local/lib/python3.10/site-packages/oktaawscli/aws_auth.py", line 139, in check_sts_token
sts.get_caller_identity()
File "/usr/local/lib/python3.10/site-packages/botocore/client.py", line 530, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/usr/local/lib/python3.10/site-packages/botocore/client.py", line 943, in _make_api_call
http, parsed_response = self._make_request(
File "/usr/local/lib/python3.10/site-packages/botocore/client.py", line 966, in _make_request
return self._endpoint.make_request(operation_model, request_dict)
File "/usr/local/lib/python3.10/site-packages/botocore/endpoint.py", line 119, in make_request
return self._send_request(request_dict, operation_model)
File "/usr/local/lib/python3.10/site-packages/botocore/endpoint.py", line 202, in _send_request
while self._needs_retry(
File "/usr/local/lib/python3.10/site-packages/botocore/endpoint.py", line 354, in _needs_retry
responses = self._event_emitter.emit(
File "/usr/local/lib/python3.10/site-packages/botocore/hooks.py", line 412, in emit
return self._emitter.emit(aliased_event_name, **kwargs)
File "/usr/local/lib/python3.10/site-packages/botocore/hooks.py", line 256, in emit
return self._emit(event_name, kwargs)
File "/usr/local/lib/python3.10/site-packages/botocore/hooks.py", line 239, in _emit
response = handler(**kwargs)
File "/usr/local/lib/python3.10/site-packages/botocore/retryhandler.py", line 207, in call
if self._checker(**checker_kwargs):
File "/usr/local/lib/python3.10/site-packages/botocore/retryhandler.py", line 284, in call
should_retry = self._should_retry(
File "/usr/local/lib/python3.10/site-packages/botocore/retryhandler.py", line 320, in _should_retry
return self._checker(attempt_number, response, caught_exception)
File "/usr/local/lib/python3.10/site-packages/botocore/retryhandler.py", line 363, in call
checker_response = checker(
File "/usr/local/lib/python3.10/site-packages/botocore/retryhandler.py", line 247, in call
return self._check_caught_exception(
File "/usr/local/lib/python3.10/site-packages/botocore/retryhandler.py", line 416, in _check_caught_exception
raise caught_exception
File "/usr/local/lib/python3.10/site-packages/botocore/endpoint.py", line 281, in _do_get_response
http_response = self._send(request)
File "/usr/local/lib/python3.10/site-packages/botocore/endpoint.py", line 377, in send
return self.http_session.send(request)
File "/usr/local/lib/python3.10/site-packages/botocore/httpsession.py", line 482, in send
raise SSLError(endpoint_url=request.url, error=e)
botocore.exceptions.SSLError: SSL validation failed for https://sts.amazonaws.com/ [Errno 2] No such file or directory

To Reproduce
Steps to reproduce the behavior:
okta-awscli --profile default

Expected behavior
It should be able to login.

Environment (please complete the following information):

  • OS: [e.g. MacOS, Ubuntu, CentOS, etc.]
  • Version of okta-awscli you're running. okta-awscli -V
    Mac OS 12.6.1
    okta-awscli version : 0.5.4
@alcima-coupa
Copy link

In case anybody else finds this issue - the problem is your default region - for the person who made this report they must have had it blank. Assuming your default region is us-east-1 it should try to go to url "https://sts.us-east-1.amazonaws.com/"

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

No branches or pull requests

2 participants