Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
HttpsUrlInfo.java - HTTPS URL Information
How to get more information about the HTTP URL object? It is created as "new java.net.URL(...)".
✍: FYIcenter
If you created a URL object with "new java.net.URL(...)",
you can use the sample Java code to get more information about the URL object:
// Copyright (c) FYIcenter.com
import java.net.*;
import java.io.*;
public class HttpsUrlInfo {
public static void main(String[] args) throws Exception {
URL url = new URL("https://www.oracle.com/");
System.out.println();
System.out.println("URL Information");
System.out.println(" URL Class Name: "+url.getClass().getName());
System.out.println(" URL as String: "+url.toString());
System.out.println(" URL Protocol: "+url.getProtocol());
System.out.println();
System.out.println("Connection Information");
URLConnection con = url.openConnection();
System.out.println(" Connection Class Name: "+con.getClass().getName());
System.out.println(" Connection as String: "+con.toString());
}
}
You can compile and run the above example in a command window:
\fyicenter>\local\jdk-1.8.0\bin\javac HttpsUrlInfo.java
\fyicenter>\local\jdk-1.8.0\bin\java HttpsUrlInfo
URL Information
URL Class Name: java.net.URL
URL as String: https://www.oracle.com/
URL Protocol: https
Connection Information
Connection Class Name: sun.net.www.protocol.https.HttpsURLConnectionImpl
Connection as String: sun.net.www.protocol.https.DelegateHttpsURLConnection:
https://www.oracle.com/
The output confirms that the sun.net.www.protocol.https.HttpsURLConnectionImpl implementation class of the JSSE API is actually used to support HTTPS communication.
You can also specify which implementation class to use with the java.protocol.handler.pkgs system property as shown below:
\fyicenter>\local\jdk-1.8.0\bin\java
-Djava.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol
HttpsUrlInfo
URL Information
URL Class Name: java.net.URL
URL as String: https://www.oracle.com/
URL Protocol: https
Connection Information
Connection Class Name: com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl
Connection as String: com.sun.net.ssl.internal.www.protocol.https.DelegateHttpsURLConnection:
https://www.oracle.com/
⇒ GetServerCertificate.java - Get Server Certificate
⇐ SSL Handshake Message Examples
2018-03-24, ∼3206🔥, 0💬
Popular Posts:
What Is wstx-asl-3.2.8.jar? wstx-asl-3.2.8.jar is JAR file for the ASL component of Woodstox 3.2.8. ...
JAX-RPC is an API for building Web services and clients that used remote procedure calls (RPC) and X...
JRE 8 rt.jar is the JAR file for JRE 8 RT (Runtime) libraries. JRE (Java Runtime) 8 is the runtime e...
What Is poi-5.2.3.jar? poi-5.2.3.jar is one of the JAR files for Apache POI 5.2.3, which provides an...
JDK 17 jdk.jcmd.jmod is the JMOD file for JDK 17 JCmd tool, which can be invoked by the "jcmd" comma...