Browse Source
Merge pull request #39 from gmonnerat/minor_changes
Pequena correção no header
pull/41/head
Junior Tada
8 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
10 additions and
14 deletions
-
pynfe/processamento/comunicacao.py
-
separarpfx.sh
|
|
@ -472,18 +472,14 @@ class ComunicacaoSefaz(Comunicacao): |
|
|
|
|
|
|
|
|
def _post_header(self): |
|
|
def _post_header(self): |
|
|
"""Retorna um dicionário com os atributos para o cabeçalho da requisição HTTP""" |
|
|
"""Retorna um dicionário com os atributos para o cabeçalho da requisição HTTP""" |
|
|
# PE é a únca UF que exige SOAPAction no header |
|
|
|
|
|
|
|
|
# PE é a única UF que exige SOAPAction no header |
|
|
|
|
|
response = { |
|
|
|
|
|
'content-type': 'application/soap+xml; charset=utf-8;', |
|
|
|
|
|
'Accept': 'application/soap+xml; charset=utf-8;', |
|
|
|
|
|
} |
|
|
if self.uf.upper() == 'PE': |
|
|
if self.uf.upper() == 'PE': |
|
|
return { |
|
|
|
|
|
'content-type': 'application/soap+xml; charset=utf-8;', |
|
|
|
|
|
'Accept': 'application/soap+xml; charset=utf-8;', |
|
|
|
|
|
'SOAPAction': '' |
|
|
|
|
|
} |
|
|
|
|
|
else: |
|
|
|
|
|
return { |
|
|
|
|
|
'content-type': 'application/soap+xml; charset=utf-8;', |
|
|
|
|
|
'Accept': 'application/soap+xml; charset=utf-8;' |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
response["SOAPAction"] = "" |
|
|
|
|
|
return response |
|
|
|
|
|
|
|
|
def _post(self, url, xml): |
|
|
def _post(self, url, xml): |
|
|
certificado_a1 = CertificadoA1(self.certificado) |
|
|
certificado_a1 = CertificadoA1(self.certificado) |
|
|
|
|
|
@ -9,5 +9,5 @@ |
|
|
# |
|
|
# |
|
|
# The directory will now have a file cert.pem and a key.pem. |
|
|
# The directory will now have a file cert.pem and a key.pem. |
|
|
|
|
|
|
|
|
openssl pkcs12 -in C.pfx -nocerts -nodes -out key.pem -passin pass:1234 |
|
|
|
|
|
openssl pkcs12 -in C.pfx -clcerts -nokeys -out cert.pem -passin pass:1234 |
|
|
|
|
|
|
|
|
openssl pkcs12 -in $1 -nocerts -nodes -out key.pem -passin pass:$2 |
|
|
|
|
|
openssl pkcs12 -in $1 -clcerts -nokeys -out cert.pem -passin pass:$2 |