How to bypass SSL certificates issue in JBOSS REST ClientRequest
<p>I'm new in Jboss, and using rest easy client for connection in my jboss code. Below is the code -</p>

<pre><code>---
import org.jboss.resteasy.client.ClientRequest;
import org.jboss.resteasy.client.ClientResponse;
---
public String login() throws Exception {
---
    String URL = "https://IP//service/perform.do?operationId=XXXXX";
    ClientRequest restClient = new ClientRequest(URL);
    restClient.accept(MediaType.APPLICATION_JSON);
    restClient.body(MediaType.APPLICATION_JSON, hmap);
    ClientResponse &lt; String &gt; resp = restClient.post(String.class);
    if (resp.getStatus() != 201) {
        throw new RuntimeException("Failed : HTTPS error code : " + resp.getStatus());
    }
    BufferedReader br = new BufferedReader(new InputStreamReader(
        new ByteArrayInputStream(resp.getEntity().getBytes())));
    String output;
    System.out.println("Output from Server .... \n");
    while ((output = br.readLine()) != null) {
        System.out.println(output);
    }
    return output;
}
</code></pre>

<p>While connecting with SSL enabled server, getting certificate error "HTTP Status 500 - org.jboss.resteasy.spi.UnhandledException: javax.net.ssl.SSLException: hostname in certificate didn't match".</p>

<p>We can't change certificate at this moment, but is there any way to trust any certificate? I googled many posts, but nothing helped.</p>

<p>Anyone can tell me what is the solution of this issue.</p>