Recently I had been struggling with some code to get a https connection to work. It was coming up with an error that no trusted certificates could be found. I resolved that thanks to some feedback and sites but i've encountered a new problem -- I'm working on the program on Windows and putting into a unix server to be run. This worked fine initially with no problems, then the server changed from http to https, so I had to implement some changes to deal with this -- now however, even though it works fine on windows when put on unix, it throws up this error Connection refused

here's the code..

        // set protocol to java.protocol.handler.pkgs property to 'HTTP'
        // -- to do with if report server site is HTTPS
        // Trustmanager -- set to trust any certificate for a secure server
 		TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {
 			public[] getAcceptedIssuers() {
 				return null;
 			public void checkClientTrusted([] certs, String authType) {
 			public void checkServerTrusted([] certs, String authType) {
 		} };

 		try {
 			SSLContext sc = SSLContext.getInstance("SSL");
 			sc.init(null, trustAllCerts, new;
 		} catch (Exception e) {

 		URL url = null;
 		try {
 			url = new URL( rptUrl );	//rptUrl contains url to use
 		} catch (MalformedURLException mue) {

		//HttpsURLConnection c;
		try {

			URLConnection c = url.openConnection();

			//set cache and request method settings

			//set other headers
			c.setRequestProperty ("Content-Type", "application/pdf");
			//connect to the server..

			////some code about what to do with file etc etc....
Any ideas why unix isnt liking this? Thanks a lot