import java.net.*;
import javax.net.ssl.*;
import java.security.*;
import java.io.*;

public class SSLGet {
    public static void main(String[] args) throws Exception {
        int port=443; // HTTPS uses 443 by default
        String server=args[0];
        SSLSocketFactory factory;
        factory=(SSLSocketFactory)SSLSocketFactory.getDefault();
        SSLSocket socket=(SSLSocket)factory.createSocket(server,port);
        Writer out=new OutputStreamWriter(socket.getOutputStream());
        out.write("GET https://" + server + "/ HTTP/1.0\r\n\r\n");
        out.flush();
        BufferedReader in = new BufferedReader(
                     new InputStreamReader(socket.getInputStream()));
        int c;
        while ((c=in.read())!=-1) System.out.print((char)c);
        out.close();
        in.close();
        socket.close();
    }
}
