Jboss 4.2 consuming SOA (bus) with SSL

Asked

Viewed 41 times

0

I have to put an app that today is running on Websphere to rotate in Jboss 4.2.

It turns out that the application consumes services from SOA (SOAP) for Bus via HTTPS and there’s the problem I’m facing.

In possession of the certificate, I managed a Keystore where I stored the key, set up the xml server. application and even configured the properties-service.xml.

I’ve made several mistakes that I’ll even put down:

INFO  [ChaveIntegracaoAspect] Início Integração SERVICO_CONSULTA_XPTO -documento: F=99999999999 -tipoIdentificacao: 2
INFO  [ChaveIntegracaoAspect] Fim Integração SERVICO_CONSULTA_XPTO -documento: F=99999999999 -erro: HTTP transport error: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
ERROR [ChaveIntegracaoAspect] Erro na Integração SERVICO_CONSULTA_XPTO -documento: F=99999999999 -erro: HTTP transport error: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

INFO  [ChaveIntegracaoAspect] Início Integração SERVICO_CONSULTA_XPTO -documento: F=9999999999 -tipoIdentificacao: 2
INFO  [ChaveIntegracaoAspect] Fim Integração SERVICO_CONSULTA_XPTO -documento: F=9999999999 -erro: null
ERROR [ChaveIntegracaoAspect] Erro na Integração SERVICO_CONSULTA_XPTO -documento: F=9999999999 -erro: null
INFO  [ChaveIntegracaoAspect] Fim Integração SERVICO_CONSULTA_XPTO -documento: F=9999999999
ERROR [CadastroPessoaProvider] [4e546712] Erro ao consultar o CPF 9999999999 - Exception: null - com.xpto.xptoprint.client.util.ConfigWebService.incluirConfiguracoesDefaultWebserviceJAXWS(155);   com.xpto.xptoprint.client.util.ConfigWebService.incluirConfiguracoesDefaultComAutenticacaoWebserviceJAXWS(124); ....    org.apache.tomcat.util.net.JIoEndpoint$Worker.run(446)

After configuring the properties-service.xml

INFO  [ChaveIntegracaoAspect] Fim Integração CONSULTA_RESGATE_XPTO -documento: F=9999999999 -erro: HTTP transport error: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
ERROR [ChaveIntegracaoAspect] Erro na Integração CONSULTA_RESGATE_XPTO -documento: F=9999999999 -erro: HTTP transport error: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
INFO  [ChaveIntegracaoAspect] Fim Integração CONSULTA_RESGATE_XPTO -documento: F=9999999999
ERROR [ResgatePontoCartaoServiceProvider] [5ab5b336] com.sun.xml.ws.client.ClientTransportException: HTTP transport error: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
INFO  [ChaveIntegracaoAspect] Início Integração SERVICO_XPTO -documento: F=9999999999 -tipoIdentificacao: 2
INFO  [ChaveIntegracaoAspect] EntradaIntegracaoXpto [cpf=9999999999
INFO  [ChaveIntegracaoAspect] Fim Integração SERVICO_XPTO -documento: F=9999999999 -erro: HTTP transport error: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
ERROR [ChaveIntegracaoAspect] Erro na Integração SERVICO_XPTO -documento: F=9999999999 -erro: HTTP transport error: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
INFO  [ChaveIntegracaoAspect] Fim Integração SERVICO_XPTO -documento: F=9999999999
ERROR [CartaoEaiFacadeImpl] [5ab5b336] com.sun.xml.ws.client.ClientTransportException: HTTP transport error: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
INFO  [ChaveIntegracaoAspect] Início Integração SERVICO_CONSULTA_SEGURADO -documento: F=9999999999 -tipoIdentificacao: 2
INFO  [ChaveIntegracaoAspect] Fim Integração SERVICO_CONSULTA_SEGURADO -documento: F=9999999999 -erro: HTTP transport error: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
ERROR [ChaveIntegracaoAspect] Erro na Integração SERVICO_CONSULTA_SEGURADO -documento: F=9999999999 -erro: HTTP transport error: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
INFO  [ChaveIntegracaoAspect] Fim Integração SERVICO_CONSULTA_SEGURADO -documento: F=9999999999
ERROR [CadastroPessoaProvider] [5ab5b336] Erro ao consultar o CPF 9999999999 - Exception Caused By: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty - sun.security.ssl.Alerts.getSSLException(208);    sun.security.ssl.SSLSocketImpl.fatal(1884); 
INFO  [PPWHttpSessionListener] [556ba663] Sessão Destruída:  ID: A4F91CA9A024110B0406DBAC1E34A727 >>DATA/HORA: 30/05/2019 17:06 []

I simply need to consume a SOA service that is exposed with https and can’t find a solution.

1 answer

0

I got the answer to the above question.

Tutorial

Download the class file Installcert.java

Compile the class

javac InstallCert.java

Access the server and retrieve the certificate (accept the standard 1 certificate)

java InstallCert [host]:[port]

Example:

java InstallCert java InstallCert barramento.com.br:443

Copy the Keystore jssecacerts to the Java security folder

"jssecacerts" para "C:\Program Files\Java\jre1.8.0_171\lib\security\"

Extract certificate from created Keystore jssecacerts

keytool -exportcert -alias [host]-1 -keystore jssecacerts -storepass changeit -file [host].cer

Example:

keytool -exportcert -alias barramento.com.br-1 -keystore "C:\Program Files\Java\jre1.8.0_171\lib\security\jssecacerts" -storepass changeit -file barramento.com.br.cer

Import certificate to the Keystore from the system

keytool -importcert -alias [host] -keystore [path to system keystore] -storepass changeit -file [host].cer

Example:

keytool -importcert -alias barramento.com.br -keystore "C:\Program Files\Java\jre1.8.0_171\lib\security\cacerts" -storepass changeit -file barramento.com.br.cer

Repository for downloading the Installcert

https://github.com/escline/InstallCert

Worked!!!

Browser other questions tagged

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