private synchronized HttpClient getHttpClient() {
		if (client == null) {
			// #ifdef DEBUG
			log.info("Creating HttpClient instance"); //$NON-NLS-1$
			// #endif
			client = new HttpClient(aditoHostname, aditoPort, isSecure);
			client.setAuthenticationPrompt(defaultAuthenticationPrompt != null ? defaultAuthenticationPrompt : getGUI());
			if (defaultProxyHost != null && !defaultProxyHost.equals("")) { //$NON-NLS-1$
				// #ifdef DEBUG
				log.info("Configuring proxies for HttpClient instance"); //$NON-NLS-1$
				// #endif
				client
						.setProxyAuthenticationPrompt(defaultProxyAuthenticationPrompt);
				client.setProxyHost(defaultProxyHost);
				client.setProxyPort(defaultProxyPort);
				client.setProxyType(defaultProxyType);

				if (defaultProxyCredentials != null
						&& defaultProxyCredentials.getUsername() != null
						&& !defaultProxyCredentials.getUsername().equals("")) { //$NON-NLS-1$
					/**
					 * LDP - This used to set preemptive authentication but its
					 * causing problems with NTLM
					 */
					client.setProxyCredentials(defaultProxyCredentials);

					/**
					 * LDP - It seems preemptive might be needed for Basic
					 * authentication. There are lots of users seeing
					 * EOFExceptions after 407 proxy authentication required.
					 */
					if ("BASIC"
							.equalsIgnoreCase(defaultProxyPreferredAuthentication)) {
						client.setProxyPreemptiveAuthentication(true);
					}
				}
				client
						.setProxyPreferedAuthentication("AUTO".equalsIgnoreCase(defaultProxyPreferredAuthentication) ? null //$NON-NLS-1$
								: defaultProxyPreferredAuthentication);
			}
		}

		return client;
	}