diff --git a/afip_auth.py b/afip_auth.py index a1b0ca2..80fbe61 100644 --- a/afip_auth.py +++ b/afip_auth.py @@ -60,7 +60,7 @@ def authenticate(service, certificate, private_key, force=False, # cryptographically sing the access ticket cms = wsaa.SignTRA(tra, certificate, private_key) # connect to the webservice: - wsaa.Conectar(cache, wsdl, proxy) + wsaa.Conectar(cache, wsdl, proxy, cacert=True) # call the remote method ta = wsaa.LoginCMS(cms) if not ta: @@ -79,7 +79,7 @@ def authenticate(service, certificate, private_key, force=False, # cryptographically sing the access ticket cms = wsaa.SignTRA(tra, certificate, private_key) # connect to the webservice: - wsaa.Conectar(cache, wsdl, proxy) + wsaa.Conectar(cache, wsdl, proxy, cacert=True) # call the remote method ta = wsaa.LoginCMS(cms) if not ta: diff --git a/currency.py b/currency.py index d9c1778..d67ae21 100644 --- a/currency.py +++ b/currency.py @@ -88,7 +88,7 @@ def get_afip_rate(self, service='wsfex'): cache_dir = afip_auth.get_cache_dir() ws.LanzarExcepciones = True try: - ws.Conectar(wsdl=wsdl, cache=cache_dir) + ws.Conectar(wsdl=wsdl, cache=cache_dir, cacert=True) except Exception as e: msg = ws.Excepcion + ' ' + str(e) logger.error('WSAA connecting to afip: %s' % msg) diff --git a/invoice.py b/invoice.py index ca89d4f..82d7808 100644 --- a/invoice.py +++ b/invoice.py @@ -1200,7 +1200,7 @@ def conect_afip(cls, ws, wsdl, vat_number, auth_data): cache_dir = afip_auth.get_cache_dir() ws.LanzarExcepciones = True try: - ws.Conectar(wsdl=wsdl, cache=cache_dir) + ws.Conectar(wsdl=wsdl, cache=cache_dir, cacert=True) except Exception as e: msg = ws.Excepcion + ' ' + str(e) logger.error('WSAA connecting to afip: %s' % msg) diff --git a/setup.py b/setup.py index 33d7922..b21fda6 100644 --- a/setup.py +++ b/setup.py @@ -55,6 +55,7 @@ def get_require_version(name): requires.append('httplib2') requires.append('pyafipws') requires.append('pysimplesoap') +requires.append('certifi>=2020.4.5.1') #requires.append('suds>=0.4') tests_require = [get_require_version('proteus'), 'pytz'] diff --git a/tests/scenario_invoice_pos_electronic.rst b/tests/scenario_invoice_pos_electronic.rst index dae2372..05f50e5 100644 --- a/tests/scenario_invoice_pos_electronic.rst +++ b/tests/scenario_invoice_pos_electronic.rst @@ -179,7 +179,7 @@ SetUp webservice AFIP:: >>> wsfev1.Cuit = company.party.vat_number >>> wsfev1.Token = auth_data['token'] >>> wsfev1.Sign = auth_data['sign'] - >>> wsfev1.Conectar(wsdl=URL_WSFEv1, cache=cache) + >>> wsfev1.Conectar(wsdl=URL_WSFEv1, cache=cache, cacert=True) True Get CompUltimoAutorizado and configure sequences:: diff --git a/tests/scenario_invoice_pos_electronic_fce.rst b/tests/scenario_invoice_pos_electronic_fce.rst index 53c708f..1a26480 100644 --- a/tests/scenario_invoice_pos_electronic_fce.rst +++ b/tests/scenario_invoice_pos_electronic_fce.rst @@ -216,7 +216,7 @@ SetUp webservice AFIP:: >>> wsfev1.Cuit = company.party.vat_number >>> wsfev1.Token = auth_data['token'] >>> wsfev1.Sign = auth_data['sign'] - >>> wsfev1.Conectar(wsdl=URL_WSFEv1, cache=cache) + >>> wsfev1.Conectar(wsdl=URL_WSFEv1, cache=cache, cacert=True) True Get CompUltimoAutorizado and configure sequences:: diff --git a/tests/scenario_invoice_pos_electronic_wsfex.rst b/tests/scenario_invoice_pos_electronic_wsfex.rst index 0a2db96..cf1fe81 100644 --- a/tests/scenario_invoice_pos_electronic_wsfex.rst +++ b/tests/scenario_invoice_pos_electronic_wsfex.rst @@ -191,7 +191,7 @@ SetUp webservice AFIP:: >>> wsfexv1.Cuit = company.party.vat_number >>> wsfexv1.Token = auth_data['token'] >>> wsfexv1.Sign = auth_data['sign'] - >>> wsfexv1.Conectar(wsdl=URL_WSFEXv1, cache=cache) + >>> wsfexv1.Conectar(wsdl=URL_WSFEXv1, cache=cache, cacert=True) True GetLastCMP and configure sequences::