FileDocCategorySizeDatePackage
SSLSimpleClient.javaAPI DocExample745Mon Jan 15 12:05:56 GMT 2001javasec.samples.ch14

SSLSimpleClient

public class SSLSimpleClient extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

        SocketFactory sf = SSLSocketFactory.getDefault();
        Socket s = sf.createSocket(args[0], Integer.parseInt(args[1]));

        BufferedReader br = new BufferedReader(
                                    new InputStreamReader(
                                        s.getInputStream()));
        PrintWriter pw = new PrintWriter(s.getOutputStream());
        System.out.println("Who is Sylvia?");
        pw.println("Who is Sylvia?");
        pw.flush();
        System.out.println(br.readLine());
        s.close();