2

I'm following the example atb the end of chapter 3 in Sunil Gulabani's Developing RESTful Web Services with Jersey 2.0" Here's the code:

SSLContext sslContext = null;

   try {
       sslContext = SSLContext.getInstance("SSL");
   } catch (NoSuchAlgorithmException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (NullPointerException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    Client client = ClientBuilder.newBuilder().sslContext(sslContext).build();

The error I get is:

SSLContextImpl is not initialized

I certainly do initialize SSLContext, but SSLContext behaves like a regular class and not like an interface. So, what is SSLContextImpl. Anyone have any ideas?

Thanks, Rob

Paul Samsotha
  • 205,037
  • 37
  • 486
  • 720
caspersgrin
  • 241
  • 1
  • 5
  • 15

1 Answers1

5

You have to call SSLContext.init() with appropriate parameters.

user207421
  • 305,947
  • 44
  • 307
  • 483