• HTTP and HTTPS are request and response protocols where a client sends a request and a server sends a response to the client
  • Some methods supported by these protocols include:
    – GET
    – POST
    – DELETE
    – PUT
  • HTTPS protocol:
    – Creates a secure connection via SSL/TLS sockets
    – Verifies sender’s identity by checking certificates
    – Performs requesting/receiving of data
  • javax.net.ssl.HttpsURLConnection is an extension of java.net.HttpsURLConnection class supporting https-specific features
  • Classes used for HTTPS URL connections include
    – java.net.URL, java.net.URLConnection,
    – java.net.HttpURLConnection, and
    – javax.net.ssl.HttpURLConnection

Insecure HTTP Server Code

  • In the code, ProcessConnection class is used for creating a new request in multi-threaded HTTP server and shipDocument mehtod to send a document to the server; however, the authenticity of the communication is questioned

Secure HTTP Server Code

  • In the code, before creating a connection with the HTTP server, a certificate is generated to make it more secure and it uses the getServer() method to make a secure server socket connection on HTTPS default port number 443