URL url = new URL("https://personal-PC:8443/SampleWebApp/HelloWorld"); URLConnection connection = url.openConnection(); if (connection instanceof HttpsURLConnection) { ((HttpsURLConnection) connection).setHostnameVerifier(new HostnameVerifier() { public boolean verify(String hostname, SSLSession session) { //TODO: Logic controlling the verfication. return true; } }); } BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); //Rest of the IO code.In the code above, I am just returning true for what ever comes in as host name, you shall write your logic here to handle the situation the way you like. With the above code in place, you will be able to use all valid names to refer your machine in the URL including computer name and localhost/127.0.0.1 (only for testing purposes).
Why NoSQL is in fashion?
-
Couple of years back NoSQL was relatively unheard term. It has become a
new buzzword in town, catching people's imagination. Almost all big daddies
of Int...
13 years ago
No comments:
Post a Comment