Skip to main content

Configuring HTTP Image Downloads

Purpose and scope​

Publishing Server downloads images from HTTP and HTTPS URLs when generating media asset previews, including Neowise previews. The properties described here control the outgoing server connections made by ImageLoader through ImageUtilsServiceBean.

They do not control preview dimensions, image scaling, local file access, or downloads performed directly by the browser. Media objects read through the file or object storage path do not use these HTTP settings.

Property names and configuration​

ImageLoader reads these values using Java's System.getProperty(...). They must be available as system properties in the Publishing Server JVM. A value stored only in an application configuration file is not read by this code unless another component makes it available as a Java system property.

Although the properties are read by ImageLoader, their names use the fully qualified name of ImageUtilsServiceBean. Use the complete keys below exactly as written, including the _PROP suffix where present. Keys beginning with com.priint.pubserver.util.ImageUtils. belong to the deprecated implementation and are not read by ImageLoader.

If a property is absent, its default value is used. If an integer property cannot be parsed, a warning is logged and its default value is used.

Connection timeout​

Full property name:

com.priint.pubserver.engine.content.imageutils.ImageUtilsServiceBean.HTTP_CONNECT_TIMEOUT_PROP
  • Type: integer, in milliseconds.
  • Default: 5000 (5 seconds).

Limits the time allowed to establish the connection to the image URL. The value is passed to HttpURLConnection.setConnectTimeout(...) for both HTTP and HTTPS downloads.

Use a non-negative value. 0 means no connection timeout. A negative value causes the connection setup to fail; it does not select the default.

Read timeout​

Full property name:

com.priint.pubserver.engine.content.imageutils.ImageUtilsServiceBean.HTTP_READ_TIMEOUT_PROP
  • Type: integer, in milliseconds.
  • Default: 10000 (10 seconds).

Limits how long a read operation waits for data from the image server. The value is passed to HttpURLConnection.setReadTimeout(...) for both HTTP and HTTPS downloads. This is not an overall time limit for downloading the entire image.

Use a non-negative value. 0 means no read timeout. A negative value causes the connection setup to fail; it does not select the default.

Allow insecure HTTPS connections​

Full property name:

com.priint.pubserver.engine.content.imageutils.ImageUtilsServiceBean.HTTPS_ALLOW_INSECURE_PROP
  • Type: integer flag.
  • Default: 0.
  • Values: 0 keeps normal HTTPS validation; any non-zero integer enables insecure HTTPS handling.

When enabled for an HTTPS URL, the loader installs a trust manager that accepts all server certificates and a hostname verifier that accepts all hostnames. This disables certificate trust and hostname validation for that connection. HTTP connections are unaffected.

Use this setting only for controlled testing. For production, keep 0 and configure trusted certificates instead. The property expects a number, such as 1, rather than true or false.

SSL/TLS context for insecure HTTPS​

Full property name:

com.priint.pubserver.engine.content.imageutils.ImageUtilsServiceBean.HTTPS_CONTEXT_PROP
  • Type: string naming an SSL context algorithm supported by the JVM.
  • Default: TLSv1.2.

Selects the algorithm passed to SSLContext.getInstance(...) when the loader creates an insecure HTTPS connection.

This property is used only when the URL uses HTTPS and HTTPS_ALLOW_INSECURE_PROP is non-zero. With normal HTTPS validation enabled, the loader uses the JVM's standard HTTPS configuration and does not read this property to select a context.

An unsupported algorithm causes the download attempt to fail and a warning to be logged. The default is not retried in that case.

User-Agent request header​

Full property name:

com.priint.pubserver.engine.content.imageutils.ImageUtilsServiceBean.HTTP_CONNECT_ADD_USER_AGENT
  • Type: string.
  • Default: empty string.

Adds the configured value as a User-Agent request header for outgoing HTTP and HTTPS image downloads. This can be useful when an image server requires an explicit client identification.

With an empty value, ImageLoader does not explicitly add this header. The underlying Java HTTP implementation may still send its own default User-Agent.

Example value:

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36

Download cache and failures​

The loader checks its downloaded-image cache before opening a connection. A cache hit returns the stored bytes without reading these properties or making another HTTP request. Changed connection settings therefore apply when an actual download is performed, not when an existing cached image is returned.

If a connection or download fails, the loader logs the failure and returns no image bytes. Depending on the caller, the preview service can then return a placeholder image or report that no preview is available.