Skip to content

PackageLoaderSvc.loadPackageUrlContents() ignores system proxy settings (missing .useSystemProperties()) #986

Description

@ad-ehealth

Hello,

When downloading a FHIR package via URL (loadPackageUrlContents method), the HTTP request is built using an HttpClientBuilder that does not call .useSystemProperties(). As a result, standard JVM system properties (-Dhttp.proxyHost, -Dhttp.proxyPort, -Dhttps.proxyHost, -Dhttps.proxyPort, -Dhttp.nonProxyHosts, etc.) are completely ignored, and Apache HttpClient always attempts a direct connection to the target host.

In a corporate environment where outbound internet access is required to go through an HTTP proxy, this call fails with a timeout, even though the JVM proxy configuration is correct and works fine for the rest of the application.

Suggested fix

Simply add .useSystemProperties() when building the client:

ca.uhn.fhir.jpa.packages.loader.PackageLoaderSvc, method loadPackageUrlContents

HttpClientConnectionManager connManager = new BasicHttpClientConnectionManager();
try (CloseableHttpResponse request = HttpClientBuilder.create()
       .setConnectionManager(connManager)
       .useSystemProperties()
       .build()
       .execute(new HttpGet(thePackageUrl))) {
    ...

Thx for your help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions