public static HttpURLConnection getContent(String httpUrlString,
			Properties httpRequestProperties, boolean allowRedirect) throws MalformedURLException,
			IOException {

		URL url = new URL(httpUrlString);
		String protocol = url.getProtocol();

		if ("https".equals(protocol)) {
			// force password prompt before connecting
			if (!ApplicationKeyManagerFactory.initialize()) {
				if (ApplicationKeyManagerFactory.getKeyStore() != null) {
					// Report error condition?
					throw new IOException("Failed to initialize PKI certificate keystore");
				}
				// continue without private keystore
			}
		}
		else if (!"http".equals(protocol)) {
			throw new MalformedURLException("Unsupported protocol: " + protocol);
		}

		HttpURLConnection c = (HttpURLConnection) url.openConnection();
		if (allowRedirect) {
			c.setInstanceFollowRedirects(true);
		}
		c.setRequestMethod("GET");
		if (httpRequestProperties != null) {
			for (String name : httpRequestProperties.stringPropertyNames()) {
				c.setRequestProperty(name, httpRequestProperties.getProperty(name));
			}
		}

		int rc = c.getResponseCode();
		if (rc != HttpURLConnection.HTTP_OK) {
			throw new IOException(c.getResponseMessage());
		}

		Msg.info(HttpUtil.class, "Get URL content: " + url);
		if (!url.equals(c.getURL())) {
			Msg.info(HttpUtil.class, "Actual URL: " + c.getURL());
		}
		Msg.info(HttpUtil.class, " > Content-Type=" + c.getHeaderField("Content-Type"));

		String contentLengthStr = c.getHeaderField("Content-Length");
		if (contentLengthStr == null) {
			c.disconnect();
			String encodingStr = c.getHeaderField("Transfer-Encoding");
			if (encodingStr != null) {
				throw new IOException("Unsupport HTTP transfer encoding: " + encodingStr);
			}
			throw new IOException("Unsupported HTTP transfer (Content-Length not specified)");
		}
		Msg.info(HttpUtil.class, " > Content-Length=" + contentLengthStr);

		return c;
	}
Execute an HTTP/HTTPS GET request and return the resulting HttpURLConnection.
@param httpUrlString HTTP/HTTPS URL
@param httpRequestProperties optional HTTP request header values to be included (may be null)
@param allowRedirect allow site redirects to be handled if true
@return HttpURLConnection which contains information about the URL
@throws MalformedURLException bad httpUrlString specified
@throws IOException if an error occurs while executing request
Ghidra/Framework/Generic/src/main/java/ghidra/net/http/HttpUtil.java