FileDocCategorySizeDatePackage
CustomSSLExample.javaAPI DocExample1908Wed May 18 09:39:00 BST 2005com.discursive.jccook.httpclient

CustomSSLExample

public class CustomSSLExample extends Object

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

		HttpClient client = new HttpClient();
		String url = "https://pericles.symbiont.net/jccook";
		
		ProtocolSocketFactory socketFactory =
			new EasySSLProtocolSocketFactory();
		Protocol https = new Protocol( "https", socketFactory, 443);
		Protocol.registerProtocol( "https", https );
		
		HttpMethod method = new GetMethod( url );
		client.executeMethod( method );
		String response = method.getResponseBodyAsString();
		System.out.println( response );
		method.releaseConnection();
		method.recycle();