How do I "settar" the digital certificate, when implementing wsdl from Sefaz, via cmd wsimport?

Asked

Viewed 136 times

-1

Hello, I’m trying to implement the java classes, by wsdl of the Sefaz web service, via cxf wsimport. As you all know, to consume Sefaz web services, you need to have a digital certificate, and I do. However I don’t know how to pass this certificate on cmd, wsmport. For this reason I get this error:

[ERROR] PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Falha ao ler o documento WSDL: https://nfe.sefa.pr.gov.br/nfe/NFeInutilizacao4?wsdl, porque 1) não pôde localizar o documento; 2) o documento não pôde ser lido; 3) o elemento-raiz do documento não é <wsdl:definitions>. 

How do I do that?? Thank you!

1 answer

1

I believe you should add the certificate to the "cacerts" of your JVM through the keytool utility. See the example below. Remember to adjust the paths according to your environment:

/usr/lib/jvm/jre1.8.0_251/bin/keytool -import -storepass changeit -alias alias_certificado -keystore /usr/lib/jvm/jre1.8.0_251/lib/security/cacerts -file /home/user/Downloads/certificado.pem

Browser other questions tagged

You are not signed in. Login or sign up in order to post.