Jboss AS 7 using proxy with HTTPS

Asked

Viewed 205 times

1

I have a Jboss server on my machine for developing tests. In the company where I work we have a proxy. I need to test the Google recaptcha. It uses https. I set up the proxy information in the tag system-properties of the archive standalone.xml of Jboss, as below:

<system-properties>
    <property name="http.proxyHost" value="xxxx"/>
    <property name="http.proxyPort" value="8080"/>
    <property name="http.proxyUser" value="xxxx"/>
    <property name="http.proxyPassword" value="xxxx"/>
    <property name="http.nonProxyHosts" value="localhost"/>

    <property name="https.proxyHost" value="xxxx"/>
    <property name="https.proxyPort" value="8080"/>
    <property name="https.proxyUser" value="xxxx"/>
    <property name="https.proxyPassword" value="xxxx"/>
    <property name="https.nonProxyHosts" value="localhost"/>
</system-properties>

But when executing any call that tries to use the proxy, the server returns me the following 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

What should I do?

1 answer

1


You need to add the certificate in the key storage file used in the JVM and located in %JAVA_HOME%\lib\security\cacerts.

First you can check your certificate is already in the key storage file by running the following command:

keytool -list -keystore "%JAVA_HOME%/jre/lib/security/cacerts"

You don’t need to specify a password.

If you do not have your certificate you can download it using your browser and adding it to your key storage with the following command:

keytool -import -noprompt -trustcacerts -alias <AliasName> -file   <certificate> -keystore <KeystoreFile> -storepass <Password>

After importing you can run the first command to arrive again if your certificate has been added.

Sun/Oracle information can be found here.

I hope it helped.

References:

https://stackoverflow.com/questions/9619030/resolving-javax-net-ssl-sslhandshakeexception-sun-security-validator-validatore

Browser other questions tagged

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