Skip to content

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

@bw2

Description

@bw2

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions