You can get your exisiting code to work with https/SSL without changing a single line. However you would need the JSSE package. You can get Sun's JSSE implementation from
here. Also note that JSSE is now an integral part of jdk1.4
Also you would need to do 2 additional things:
1)Specify the https protocol handler, via the the system property,
java.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol
2)Register the SunJSSE cryptographic provider. You can do this by adding the following line in your java.security file:
security.provider.n=com.sun.net.ssl.internal.ssl.Provider
where 'n' would be the next available integer.
Or you can even do this programmatically as:
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider())
Have a look at the JSSE API User's guide. It explains everything very clearly.