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

register_service_account.py doesn't work when using the docker image #46

Open
bw2 opened this issue Jul 12, 2023 · 0 comments
Open

register_service_account.py doesn't work when using the docker image #46

bw2 opened this issue Jul 12, 2023 · 0 comments

Comments

@bw2
Copy link

bw2 commented Jul 12, 2023

register_service_account.py fails with a "CERTIFICATE_VERIFY_FAILED" error when running in the latest docker image (broadinstitute/firecloud-tools:latest):

+ python scripts/register_service_account/register_service_account.py -j /gsa-key/key.json -e [email protected]
/usr/local/lib/python2.7/dist-packages/OpenSSL/crypto.py:14: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release.
  from cryptography import utils, x509
Traceback (most recent call last):
  File "scripts/register_service_account/register_service_account.py", line 47, in <module>
    main()
  File "scripts/register_service_account/register_service_account.py", line 39, in main
    request = requests.post(uri, headers=headers, json=profile_json)
  File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 119, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 514, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='api.firecloud.org', port=443): Max retries exceeded with url: /register/profile (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)'),))

To fix it, I replaced
requests.post(uri, headers=headers, json=profile_json)
with
requests.post(uri, headers=headers, json=profile_json, verify=False)
in my code @ https://github.com/bw2/hail-utils/blob/master/register_hail_batch_service_account_as_terra_user.py#L65

@bw2 bw2 changed the title docker image no longer works register_service_account.py doesn't work when using the docker image Jul 12, 2023
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

1 participant