The normal methods that work with "http:" URLs should also work with "https:" URLs. If they don't, then the probable cause is not the code but something else:
The URLs might use a SSL certificate that is not acceptable to Java. It might be self-signed, it might use a root certificate that your JVM's certificate store doesn't include. It might be the wrong certificate for the site.
It might be a problem with your JVM's proxy configurations. (You can't proxy HTTPS).
The remote site might simply not be listening for HTTPS requests.
The remote site might filter HTTPS requests based on header fields; e.g. the agent header.
To help us help you find the problem:
- tell us what URL you are trying to access,
- tell us if the URL works for you using a web browser,
- if there are exceptions, show us the stacktraces.