Hello,
Ich wrote a custom Jira connector for camunda 8.9 using Camunda Java Spring SDK. The connector has been deployed within a k8s cluster that does not allow traffic to internet. For this connector, I need to make some requests to a remote Jira server thorugh a Forward proxy server. But actually I can’t reach the server using one of three following options:
1st option: JAVA_TOOL_OPTIONS within env var from k8s deployment file
env:
- name: JAVA_TOOL_OPTIONS
value: -Dhttp.proxyHost=<HOST> -Dhttps.proxyPort=<PORT> -Dhttps.proxyHost=<HOST> -Dhttps.proxyPort=<PORT>
2nd option: Connector env vars recommended in HTTP proxy configuration | Camunda 8 Docs
env:
- name: CONNECTOR_HTTPS_PROXY_HOST
value: <HOST>
- name: CONNECTOR_HTTPS_PROXY_PORT
value: <PORT>
- name: CONNECTOR_HTTP_PROXY_HOST
value: <HOST>
- name: CONNECTOR_HTTP_PROXY_PORT
value: <PORT>
I also update the configuration of my RestTemplate in code to include the .useSystemProperties() Method like this:
import lombok.extern.slf4j.Slf4j;
import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
import org.apache.hc.client5.http.impl.classic.HttpClientBuilder;
import org.springframework.http.HttpStatusCode;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;
public class JiraApiRestTemplate extends RestTemplate {
public JiraApiRestTemplate(RestTemplate source) {
this.setRequestFactory(createApacheHttpRequestFactory());
if (source != null) {
this.setMessageConverters(source.getMessageConverters());
this.setClientHttpRequestInitializers(source.getClientHttpRequestInitializers());
this.setErrorHandler(source.getErrorHandler());
this.setUriTemplateHandler(source.getUriTemplateHandler());
this.setInterceptors(source.getInterceptors());
}
}
private static HttpComponentsClientHttpRequestFactory createApacheHttpRequestFactory() {
CloseableHttpClient httpClient = HttpClientBuilder.create().useSystemProperties().build();
return new HttpComponentsClientHttpRequestFactory(httpClient);
}
}
But nothing from the options above work. It means for example, when I tried to get an issue with my client, the request never reaches the jira server. On the other hand, I test the connectivity from my proxy server to my jira connector successfully using curl by doing:
curl -I -x http://<PROXY_HOST>:<PROXY_PORT> https://<JIRA_HOST>:<JIRA_PORT>
Can someone tell me why none of the options above work? Do I have to do something else?