hitting an URL in a loop
i have created a web application and hosted in on the server. now i want
to create a java program which will hit the url of my application in a
loop so that i can check how much load can my web application can handle.
also, the program, should be able to tell me that when the url was
successful accessed and when it didn't.
i tried using doing it for the single time, without using loop
try {
URL url = new URL("https://example.com/");
BufferedReader in = new BufferedReader(
new InputStreamReader(url.openStream()));
String inputLine;
while ((inputLine = in.readLine()) != null) {
System.out.println(inputLine);
}
in.close();
} catch (Exception e) {
System.out.println("e: " + e.toString());
}
but i got this error: e: javax.net.ssl.SSLHandshakeException:
java.security.cert.CertificateException: No subject alternative DNS name
matching example.com found.
No comments:
Post a Comment