on 05-20-2010 3:47 PM
Pessoal, estamos com o seguinte erro quando realizamos um teste na assinatura digital:
com.sap.engine.interfaces.messaging.api.exception.MessagingException: iaik.security.ssl.SSLCertificateException: Peer certificate rejected by ChainVerifier
Nosso ambiente é
SAP_ABA 711 0004 SAPKA71104 Cross-Application Component
SAP_BASIS 711 0004 SAPKB71104 SAP Basis Component
PI_BASIS 711 0004 SAPK-71104INPIBASIS Basis Plug-In
ST-PI 2005_1_710 0004 SAPKITLQJ4 SAP Solution Tools Plug-In
SAP_BW 711 0004 SAPKW71104 SAP Business Warehouse
APLICATION SERVER JAVA 7.1 onde esta instalado o certificado e o SLL-NFE-JWS .
alguem sabe como resolver?
Entendi Henrique,
Então estamos com o seguinte problema clássico:
com.sap.engine.interfaces.messaging.api.exception.MessagingException: iaik.security.ssl.SSLCertificateException: Peer certificate rejected by ChainVerifier
Porém este erro está acontecendo já para o cenário de Consulta do Status do Serviço, ou seja, o mais simples deles. Efetuamos o export e import novamente do certificado agora da forma correta, porém sem sucesso.
Obs: Lembrando que o PI é o 7.1 e só temos a assinatura e o certificado digital no 7.1
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
O PI está rejeitando o certificado da SEFAZ.
Para qual SEFAZ é esse erro? Tente comunicar com o NfeStatusServico de outra SEFAZ (ou mesmo ambiente de producao) pra verificar se nao eh exclusivo dessa SEFAZ / ambiente.
Ainda, para essa SEFAZ que está dando erro, tente abrir o web service no browser e salve localmente os .cer da SEFAZ e da cadeia dela (vc abre o certificado do servidor clicando 2x no icone de cadeado no browser). Depois, importe esses .cer na view TrustedCAs no Keystore do PI.
Finalmente, veja esta thread, é tb sobre PI 7.1: .
Abs,
Henrique.
Henrique
Resolvido o problema de assinatura com o import dos .CER na view TrustedCAs. Agora estamos enfrentando outros probleminhas, porém vou abrir outro forum se for o caso....
Obrigado pela ajuda.
Abraç
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Henrique,
Na verdade o pessoal está usando o 7.1 para assinar sem o certificado estar instalado no NW7.0.
Uma usuária chamada Deidre (americana) tem consultado seu Blog para coletar contigo as informações a respeito desta instalação.
Agora esta mensagem de SSL provavelmente está se referindo a classo de segurança para acesso ao certificado digital.
Antes precisávamos fechar o acordo SSL na 7.1 e 7.0 para fazer funcionar a assinatura, porém no seu blog vc menciona que não precisa mais e etc
Gostaria de saber como testar se esta classe de segurança (que comprovadamente funcionava na 7.0X) agora somente com a 7.1 e garantir que tudo nela esteja funcionando.
Carlos, o Certificado Digital é usado por outro software atualmente, por tanto ele está perfeitamente funcionando e conferi com o pessoal, a Key View e a Key Store estão corretas.
Este link e a nota que vc colocou aqui no post São da versão 7.0 e não da 7.1 do PI.... Muito cuidado
Marcos, veja que a 7.0 e 7.1 tem muita diferença com relação a assinatura digital.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thiago,
como havia comentado, o J2EE do AS JAva 7.00 (e o JEE do AS Java 7.10) precisam que o certificado tenha a cadeia de certificacao incluida no mesmo arquivo (tudo no mesmo .pfx, sem ter os .cer separados). Pra isso, vc precisa importar tudo (.pfx e os .cer) localmente no Windows, e exportar do Windows para um novo .pfx utilizando as opcoes "incluir cadeia completa" e "incluir chave privada" e desmarcar "enable strong protection". Veja aqui: .
Ainda, para testar, siga o procedimento indicado aqui:
https://wiki.sdn.sap.com/wiki/display/BPX/TestingtheNFEDigitalSignature+component
O wiki foi baseado no AS Java 7.00 mas a idéia é a mesma pro 7.10.
Ainda, eu ainda nao entendi o landscape.
O assinador foi deployado no AS Java 7.10 do PI 7.1 ou em um AS Java 7.00 separado?
Se for separado, o certificado tem que ser instalado nos 2 ambientes, no AS Java do PI pra poder fazer o SSL e no AS Java do assinador.
Pra criar a View, nao precisa alterar nenhuma daquelas configuracoes default de permissao da view.
Abs,
Henrique.
Henrique,
Entendi. Vou testar igual fazemos no 7.0 mesmo, sem problemas... Quanto ao certificado vou verificar a importação que foi feita pelo pessoal dos EUA.
Vou repetir localmente e enviar o arquivo para importação no JAVA.
O Landscape está assim:
GRC ABAP:
Foi criado um client junto com o ECC 6.0 (NW 7.0) e instalado os pacotes de acordo com o GRC (SLL NFE)
GRC JAVA PI
Foi utilizada uma instancia JAVA 7.1 já existente no Landscape do cliente
Assim está o Landscape deste cliente.
Quanto a classe de segurança, sem problemas. Acho que o problema deve estar no grant da classe XiSecurityRuntimePermission. Com tudo, vamos reimportar o certificado aqui pelo Brasil mesmo e depois verificamos se o problema do SSL continua ou não.
Certo ?
Entao vc nao está testando a Assinatura Digital!
No caso, verifique se vc exportou o certificado com cadeia completa.
Se nao, importe-o no Windows (juntamente com os .cer da cadeia), depois vah no Certificate Manager do Windows e o exporte, incluindo a chave privada e a cadeia completa e desabilitando o "strong encryption".
Abs,
Henrique.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Se vc estiver se referindo se a chave foi gerada corretamente pela entidade certificadora ( SERASA, etc ... ) basta importar o certificado digital no seu browser passando como endereco depois para testar o endereco do WebService do seu servico de verificacao de status de servico do sefaz [https://homologacao.nfe.fazenda.sp.gov.br/nfeweb/services/nfestatusservico.asmx].
Contudo, qual foi o processo que vc usou para importar o certificado no PI, foi o que eu mencionei?
The Certificate I was given for this interface is currently used in the AS 400 server and I believe the issue is the Server I am running the digital signature is akr12345 and the CN in the Certificate is akrabcde
I think that the SERASA does not like that the host names are different.
For a Test system can we use a self signed certifcate? Or do you have to use the SERASA signed certificate.
I think I need to generate a CSR for the server that we are using for the digital signature and then get it signed by SERASA. then import the signed CSR into the PI system with the certficates from SERASA.
Deidre,
please keep messages in this forum in portuguese.
But in order to help you, please notice that NFE certificate is not a server certificate, in the sense that you need the hostname in it. It is a e-PJ / e-CNPJ type, because all you need to have is the CNPJ of the company issuing NF-es in it.
All major CAs have a NF-e certificate product (SERASA, Certisign etc.).
If your provider says you need a server (hostname) certificate in addition to the CNPJ, don't accept it. All you need is the CNPJ.
Of course, due to this fact, you can't use the same certificate you have for your AS/400 application (unless it has the CNPJ in it, according to the SEFAZ specification, which I don't think is the case).
As for your question, I suppose it is not about digital signature but SSL communication, right?
For that, you won't be able to use a self-signed certificate, because even the SEFAZ test systems require a ceritificate which was signed by the Brazilian root CA (i.e. a legally valid digital certificate).
Best regards,
Henrique.
Pessoal , deixe-me esclarecer alguns fatos Na verdade atualmente existe um certificado emitido pela SERASA para a NFE, atualmente esta sendo utilizado pela empresa no sistema que roda no AS/400.... este sistema será substituído pelo SAP...
Para a realização dos testes foi enviado os seguintes arquivos do certificado do as/400 para instalação no PI:
- NFE digital certification: [attachment "NFE.pfx"
- NFE digital certification password
- Serasa digital certified "SerasaCD.cer
- Serasa certification authority: [attachment "SerasaACP.cer"
- Brazilian root: [attachment "ITI.cer"
2
3
4
5
6
Edited by: Marco Dias on May 21, 2010 4:51 PM
vou discorrer alguns passos de uma doc que eu tenho que já esta em ingles quem sabe ajude:
To grant permission for the Digital Signature service of SAP NFE, go to the
Security Provider Service in the Visual Administrator tool of the J2EE Engine.
In the Visual Administrator tool of the J2EE Engine, access the Security Provider service.
1. In the Protection Domains tab, search for the Digital Signature domain sap.com ->
grc~nfe~dsig
2. Navigate to EJBContainer -> applicationjars and select the bean entry
sap.com~grc~nfe~dsig~dsigbean.jar
3. Switch to Edit Mode and grant the u201CXiSecurityRuntimePermissionu201D permission to the
domain.
4. If this permission does not exist, you will need to create it.
Select the java.lang.RuntimePermission Class Name and enter the Target Name
as u201CXiSecurityRuntimePermission
Go to the Protection Domains tab and select the application jar referring to the Digital
Signature EJB.
Grant the XiSecurityRuntimePermission to the domain. If this permission does not exist, you
will need to create it.
In order to execute the digital signature for documents, you need digital
certificates, which are files containing a key pair (public and private keys) that
electronically assures the identity of the holder of the certificate
In the J2EE Engine of the SAP NetWeaver AS Java, the digital certificates are
maintained in the Key Storage.
To access the Key Storage, run the Visual Administrator tool and go to the Key
Storage.
The Key Storage is organized by
Views (like folders of certificates) and
Entries (each entry refers to a
certificate which was loaded into the
Key Storage).
To install the digital certificates to be
used for the SAP NFE 1.0, follow these
steps:
Choose a view to install the
certificates - either use a standard
view or create a new one using the
u201CCreate Viewu201D button
Select the chosen view, then click
the u201CLoadu201D button for the Entry.
Select the digital certificate file and
enter the proper password.
To install the digital signature, choose or create a View, then click Load for the Entry. Select
the local certificate file and enter the password.
Pessoal ,
Deixe-me esclarecer alguns fatos Na verdade atualmente existe um certificado emitido pela SERASA para a NFE, atualmente esta sendo utilizado pela empresa no sistema que roda no AS/400.... este sistema será substituído pelo SAP...
Para a realização dos testes foi enviado os seguintes arquivos do certificado do as/400 para instalação no PI:
- NFE digital certification: [attachment "NFE.pfx"
- NFE digital certification password
- Serasa digital certified "SerasaCD.cer
- Serasa certification authority: [attachment "SerasaACP.cer"
- Brazilian root: [attachment "ITI.cer"
Estes arquivos foram importados no servidor Java (ambiente UNIX) para a realização dos testes, após algumas tentativas sem sucesso na utilização deste certificado a Deidre (que é a pessoa responsável por esta instalçao nos USA) utilizou um certificado auto assinado acreditando que poderia ser utilizado para teste
No entanto, nosso time de PI aqui no Brasil é de desenvolvedores e o time de Basis/Configuração, responsável por esta instalção não tem o domínio deste processo
Aqui estão os passos utilizados para a instalçao do certificado:
1 - Instalou os Certificados da Goodyear/SERASA em servidor PI (AS JAVA u2013 ambiente UNIX)
(Configuration Management/Certificate and Keys)
2 u2013 KeyStorage->KeyStore ViewAdd View (ViewName LAT_DigitalSignature)
3 - Usando a Security tab of the key storage service web interface, assign a seguinte lista de
permissions to the codebase of the adapter in use:
A. VIEW_ALIASES
A. VIEW_ALIASES
b. GET_VIEW
c. LIST_VIEW
d. IS_VIEW_EXISTS
e. FIND_ALIAS
f. LIST_ENTRY -? ( note the Certs need to be installed before it is viewable)
g. READ_ENTRY -? ( note the Certs need to be installed before it is viewable)
h. IS_ENTRY_A_KEY -? ( note the Certs need to be installed before it is viewable)
i. IS_ENTRY_EXISTS -? ( note the Certs need to be installed before it is viewable)
(Note that permissions that are view based only need to be set once per view and
codebase/domain combination,)
Granted code-Base permission:
- LAT_DigitalSignature
- NFE
- SERASA ACP
- ITI
- SERASA CD
4 Import Entry (PKCS12# Key Pair) entry type X509 Certificate (arquivos SERASA ACP/CD e ITI).
Edited by: Marco Dias on May 21, 2010 4:58 PM
nao creio que vcs estejam realmente com um problema de camada de protocolo de transporte com seguranca, acho que deve ser mais com o seu certificado digital mesmo, afinal, o seu certificado nao esta sendo enviado ao sefaz, depois de vcs revisarem a instalacao do seu certificado de uma olhada na sxi_monitor se ele esta enviando corretamente a msg ao SEFAZ p/ o servico de verificacao de status do servidor.
aproveitando, verifique tbem, se no seu Comunnication Channel se vcs nao estao invertendo a view e a key na configuracao do certificado digital
quanto ao seu problema de SSL, hoje pela manha foi postado um erro referente a isso e a sua solucao, em resumo esta indicando para olha a nora 891877 (Message-specific configuration of HTTP-Security) e também com informações baseadas no link:
http://help.sap.com/saphelp_nw04s/helpdata/en/fb/c2953fc405330ee10000000a114084/frameset.htm
Edited by: Carlos Rodrigo Pereira on May 21, 2010 7:21 PM
Vc configurou conexao SSL para chamar o WS de assinatura??
Nao existe SSL aqui, soh nas comunicacoes com a SEFAZ.
Pra assinatura, o nome/view do certificado eh passado como parametro no XML; isso vc mantem na SPRO, view de CNPJ.
Abs,
Henrique.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
provavelmente o certificado nao foi corretamente instalado no servidor SAP PI GRC, ou vc esta usando a chave errada para acessar esse certificado.s
Vale lembrar que o certificado precisa ser do tipo A1 ( nao precisa de cartao p/ validacao ) e que o certificado deve ser importado dentro do SAP PI seguinde os seguintes passos abaixo acessando o Visual Admin. Veja se realizou todas essas etapas
1)
Deu um grant no seu certificado indo no visaul Admin -> Security Provider -> Runtime/Policy configur. tab e verifique se existe BasicPasswordLoginModule e verifique se ele esta flegado com SUFFICIENT.
2)
1. In the Protection Domains tab, search for the Digital Signature domain sap.com ->
grc~nfe~dsig
2. Navigate to EJBContainer -> applicationjars and select the bean entry
sap.com~grc~nfe~dsig~dsigbean.jar
3. Switch to Edit Mode and grant the u201CXiSecurityRuntimePermissionu201D permission to the
domain.
4. If this permission does not exist, you will need to create it.
Select the java.lang.RuntimePermission Class Name and enter the Target Name
as u201CXiSecurityRuntimePermission
CASO O XiSecurityRuntimePermission nao exista crie o mesmo
3)
Importar o certificado digital do tipo A1 no seu SAP atraves do Visual Administrator
..
Edited by: Carlos Rodrigo Pereira on May 20, 2010 8:18 PM
User | Count |
---|---|
14 | |
4 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.