private static String readOut(URL url) throws Exception {
    HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
    conn.setSSLSocketFactory(clientSslFactory.createSSLSocketFactory());
    InputStream in = conn.getInputStream();
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    IOUtils.copyBytes(in, out, 1024);
    return out.toString();
  }
This testcase issues SSL certificates configures the HttpServer to serve HTTPS using the created
certficates and calls an echo servlet using the corresponding HTTPS URL.
hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestSSLHttpServer.java