Browse Source

Desabilitando warnings de SSL - Servidor da receita utiliza self-signed certificado

pull/54/head
Danimar Ribeiro 8 years ago
parent
commit
f6bd52a3ed
  1. 3
      pytrustnfe/client.py
  2. 2
      setup.py

3
pytrustnfe/client.py

@ -2,9 +2,11 @@
# © 2016 Danimar Ribeiro, Trustcode
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import urllib3
import requests
import suds.client
import suds_requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
def get_authenticated_client(base_url, cert, key):
@ -48,6 +50,7 @@ class HttpClient(object):
def post_soap(self, xml_soap, cabecalho):
header = self._headers(cabecalho.soap_action)
urllib3.disable_warnings(category=InsecureRequestWarning)
res = requests.post(self.url, data=xml_soap,
cert=(self.cert_path, self.key_path),
verify=False, headers=header)

2
setup.py

@ -1,7 +1,7 @@
# coding=utf-8
from setuptools import setup, find_packages
VERSION = "0.1.35"
VERSION = "0.1.36"
setup(
name="PyTrustNFe",

Loading…
Cancel
Save