Skip to content

Instantly share code, notes, and snippets.

@mjgp2
Created July 2, 2013 15:07
Show Gist options
  • Select an option

  • Save mjgp2/5910088 to your computer and use it in GitHub Desktop.

Select an option

Save mjgp2/5910088 to your computer and use it in GitHub Desktop.
This doesn't work with Java 7u21 - the root ceritifcate isn't installed in the JDK. java version "1.7.0_21" Java(TM) SE Runtime Environment (build 1.7.0_21-b11) Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import com.google.common.io.ByteStreams;
public class Test {
public static void main(String[] args) throws MalformedURLException, IOException {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
ByteStreams.copy(new URL("https://www.lexisnexis.com/wsapi/v1/services/Authentication").openStream(), byteArrayOutputStream);
System.out.println(new String( byteArrayOutputStream.toByteArray()));
}
}
@mjgp2
Copy link
Author

mjgp2 commented Jul 2, 2013

Also fails with java 7u25

java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment