FileDocCategorySizeDatePackage
SSLHelloClient.javaAPI DocExample1026Wed Apr 19 11:20:18 BST 2000None

SSLHelloClient

public class SSLHelloClient extends Object
Copyright (c) 1996, 1997, 1998, 1999 Phaos Technology Corp. All rights reserved.

(Omit source code)

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

	try {
	    if (args.length < 1) {
		System.err.println("Usage: <hostName>");
		System.exit(1);
	    }

	    // This example will not work without a security manager.
	    System.setSecurityManager(new RMISecurityManager());

	    // Create a secure rmiregistry
	    Registry registry = LocateRegistry.
		getRegistry(args[0], 1099, 
			    new SSLClientSocketFactory());

	    // Obtain a reference to the HelloObject
	    Hello hello = (Hello) registry.lookup("/HelloServer");
	    System.out.println("Message: " + hello.sayHello());
	} catch (Exception e) {
	    e.printStackTrace();
	}