Existe um erro ao tentar assinar o xml com o certificado#374
Closed
WeslenPy wants to merge 2 commits intoTadaSoftware:mainfrom
Closed
Existe um erro ao tentar assinar o xml com o certificado#374WeslenPy wants to merge 2 commits intoTadaSoftware:mainfrom
WeslenPy wants to merge 2 commits intoTadaSoftware:mainfrom
Conversation
felps-dev
requested changes
Jan 7, 2025
Collaborator
felps-dev
left a comment
There was a problem hiding this comment.
Precisamos de 2 coisas:
- Testes unitários para validar a alteração.
- Garantir que isso é um bug recorrente: Tenho vários certificados com o header/footer e nunca tive problema com isso, tem certeza que seu problema não era somente os breaklines inseridos?
| self.arquivos_temp = [] | ||
|
|
||
| def separar_arquivo(self, senha, caminho=False): | ||
| def separar_arquivo(self, senha, caminho=False,replace_data=True): |
Collaborator
There was a problem hiding this comment.
O parâmetro pode ser um pouco mais descritivo?
Algo como remove_certificate_headers?
Comment on lines
+97
to
+101
| if replace_data: | ||
| cert = cert.replace("\n", "") | ||
| cert = cert.replace("-----BEGIN CERTIFICATE-----", "") | ||
| cert = cert.replace("-----END CERTIFICATE-----", "") | ||
|
|
Collaborator
There was a problem hiding this comment.
Não são todos os certificados que começam/terminam com esses valores, isso pode até funcionar com o seu, mas não vai funcionar em quem tem outro certificado.
Contributor
Author
There was a problem hiding this comment.
na verdade o erro ocorre devido a remoção dos headers
Collaborator
|
Favor visualizar: #373 (comment) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Exception has occurred: InvalidInput
No PEM-encoded certificates found in string cert input data
File "D:\Projetos\Python\emissao-nfe\main.py", line 148, in
xml = a1.assinar(nfe)
^^^^^^^^^^^^^^^
signxml.exceptions.InvalidInput: No PEM-encoded certificates found in string cert input data