users@jersey.java.net

[Jersey] SSLContext not necessary any more for common HTTPS urls (https://www.chase.com/, for example)?

From: Jianbao (Jim) Tao <"Jianbao>
Date: Sat, 30 Aug 2014 21:08:43 -0400

Hi,

I used the following groovy code to check how to use Jersey client to
access HTTPS urls:

    @Test
    void "check https url"() {
        String url = 'https://www.chase.com/'
        Client client = ClientBuilder.newClient()
        Response response = client.target(url).request().get()
        assert response.status == 200

        String text = response.readEntity( String )
        assert text.contains('<title>CHASE Bank - Credit Cards, Mortgage,
Personal & Commercial Banking')
    }

Surprisingly, the test passed. I was thinking I might have to set up an
SSLContext instance, but apparently I don't have to. So, what is happening
behind the scene? Does Jersey automatically create an SSL context from the
JRE cacerts file for HTTPS urls?

In any case, I am very curious to know what's happening. Thank you.

Best,
Jim