Skip to content

Instantly share code, notes, and snippets.

@ushkinaz
Created November 23, 2017 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ushkinaz/c4b22bb384ecf58c407828c07ab59b64 to your computer and use it in GitHub Desktop.
Save ushkinaz/c4b22bb384ecf58c407828c07ab59b64 to your computer and use it in GitHub Desktop.
TLS v1.2 test
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
public class TLS12Test {
public TLS12Test() {
}
public static void main(String[] args) throws IOException {
URL url = new URL("https://stage.cps-it.ru/loaderio-e707b6eb86109840011bb23c8d33a006.txt");
InputStream in = new BufferedInputStream(url.openStream());
ByteArrayOutputStream out = new ByteArrayOutputStream();
byte[] buf = new byte[1024];
int n;
while(-1 != (n = in.read(buf))) {
out.write(buf, 0, n);
}
out.close();
in.close();
System.out.println(new String(out.toByteArray()));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment