WhyNotHugo / django-afip

⚖️ AFIP invoice integration for django.
https://django-afip.readthedocs.io/
ISC License
48 stars 24 forks source link

Failure to authenticate with cryptography==3.1 #52

Closed WhyNotHugo closed 4 years ago

WhyNotHugo commented 4 years ago

Attempting to authenticate with AFIP with cryptography==3.1 will fail due to internal interfaces being dropped. A solution to this is being discussed upstream.

Latest master has cryptography<3.1 pinned, but for developers using older releases, make sure you add this pin to your dependencies.

gusarg81 commented 4 years ago

Hugo,

Hoy al subir un nuevo .crt (en la creación de un nuevo TaxPayer), me sale el error:

module 'lib' has no attribute 'PKCS7_sign'

¿Tiene que ver con esto no?

¿Hay algún paso extra que puedo/debo hacer para solucionarlo?

Django_afip: v7.1.2

EDIT: hice un downgrade de cryptography (a la 3.0) pero ahora tengo el siguiente error:

Traceback (most recent call last):
  File "/var/www/virtual/gdnet.ar/ebiller/htdocs/eBiller/venv/lib/python3.6/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/var/www/virtual/gdnet.ar/ebiller/htdocs/eBiller/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 179, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/var/www/virtual/gdnet.ar/ebiller/htdocs/eBiller/ebiller/apps/management/views_settings.py", line 119, in settings_taxpayer_admin
    taxpayer.fetch_points_of_sales()
  File "/var/www/virtual/gdnet.ar/ebiller/htdocs/eBiller/venv/lib/python3.6/site-packages/django_afip/models.py", line 408, in fetch_points_of_sales
    ticket = ticket or self.get_or_create_ticket('wsfe')
  File "/var/www/virtual/gdnet.ar/ebiller/htdocs/eBiller/venv/lib/python3.6/site-packages/django_afip/models.py", line 397, in get_or_create_ticket
    return self.get_ticket(service) or self.create_ticket(service)
  File "/var/www/virtual/gdnet.ar/ebiller/htdocs/eBiller/venv/lib/python3.6/site-packages/django_afip/models.py", line 378, in create_ticket
    ticket.authorize()
  File "/var/www/virtual/gdnet.ar/ebiller/htdocs/eBiller/venv/lib/python3.6/site-packages/django_afip/models.py", line 698, in authorize
    raise exceptions.AuthenticationError(str(e)) from e
django_afip.exceptions.AuthenticationError: No se puede decodificar el BASE64

EDIT2: volví a generar el certificado y ahora funciona... raro. Quizás sin querer mezclé el certificado de testing con el de producción.