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

Error in trust chain if docker images are built locally #306

Closed
mattebit opened this issue Feb 7, 2024 · 2 comments
Closed

Error in trust chain if docker images are built locally #306

mattebit opened this issue Feb 7, 2024 · 2 comments

Comments

@mattebit
Copy link
Contributor

mattebit commented Feb 7, 2024

If the docker-compose.yml is set to build all the images locally instead of pulling them from the github registry, an exception occours at the entity configuration request to the trust-anchor from the RP.

Commit used: 1faa95e

The changes made to the compose file are just uncommenting the build tags and commenting the image, for example:

trust-anchor.org:
  #image: ghcr.io/italia/spid-cie-oidc-django:latest
  build:
    context: .
    dockerfile: ./Dockerfile

This is the log of the exception.

relying-party.org-1        | 2024-02-07 11:17:48,167 spid_cie_oidc.entity.statements INFO     Starting Entity Configuration Request for http://trust-anchor.org:8000/.well-known/openid-federation
trust-anchor.org-1         | 2024-02-07 11:17:48,208 django.request ERROR    Internal Server Error: /.well-known/openid-federation
trust-anchor.org-1         | Traceback (most recent call last):
trust-anchor.org-1         |   File "/usr/local/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
trust-anchor.org-1         |     response = get_response(request)
trust-anchor.org-1         |   File "/usr/local/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response
trust-anchor.org-1         |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
trust-anchor.org-1         |   File "/opt/spid_cie_oidc/entity/views.py", line 59, in entity_configuration
trust-anchor.org-1         |     conf.entity_configuration_as_jws, content_type="application/entity-statement+jwt"
trust-anchor.org-1         |   File "/opt/spid_cie_oidc/entity/models.py", line 246, in entity_configuration_as_jws
trust-anchor.org-1         |     self.entity_configuration_as_dict,
trust-anchor.org-1         |   File "/opt/spid_cie_oidc/entity/models.py", line 218, in entity_configuration_as_dict
trust-anchor.org-1         |     "jwks": {"keys": self.public_jwks},
trust-anchor.org-1         |   File "/opt/spid_cie_oidc/entity/models.py", line 180, in public_jwks
trust-anchor.org-1         |     skey = serialize_rsa_key(key_from_jwk_dict(i).public_key())
trust-anchor.org-1         |   File "/opt/spid_cie_oidc/entity/jwks.py", line 67, in serialize_rsa_key
trust-anchor.org-1         |     if isinstance(rsa_key, cryptography.hazmat.backends.openssl.rsa._RSAPublicKey):
trust-anchor.org-1         | AttributeError: module 'cryptography.hazmat.backends.openssl' has no attribute 'rsa'
trust-anchor.org-1         | 2024-02-07 11:17:48,209 django.server ERROR    "GET /.well-known/openid-federation HTTP/1.1" 500 79744
relying-party.org-1        | 2024-02-07 11:17:48,210 spid_cie_oidc.relying_party.views.rp_landing WARNING  Failed trust chain for http://trust-anchor.org:8000/oidc/op to {'sub': 'http://trust-anchor.org:8000'}: Expecting value: line 1 column 1 (char 0)
@rglauco
Copy link
Collaborator

rglauco commented Feb 7, 2024

With the last release we have corrected this issue, by upgrading to cryptography 42.0.2, please try with v1.3.1 https://github.com/italia/spid-cie-oidc-django/releases/tag/v1.3.1

@mattebit
Copy link
Contributor Author

mattebit commented Feb 7, 2024

With 1.3.1 it works, thank you

@mattebit mattebit closed this as completed Feb 7, 2024
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