Closed doodo477 closed 6 months ago
Hi @doodo477 , Thanks for spotting this issue. I can see it was fixed in release 4.2.0. Now we can configure the connection provider by setting a java system property -DconnectorProvider=http to enable proxy connections. It accepts three values:
Regards,
Hi.
I'm the lead integration developer at Charles Darwin University - CDU. We have recently been upgrading our Mulesoft app's to the new MuleSoft Java 17 version which has resulted in having to upgrade the Mulesoft Mule-Maven-Plugin from version 3.8.2 to 4.1.0. Our app migration are going fine how-ever we've run into problems when using our onprem gitlab runner to deploy the apps to the cloudhub, I've traced the problem to the (
mule-maven-plugin\mule-deployer\src\main\java\org\mule\tools\client\core\AbstractClient.java
) file that set's thejersey.client.ClientConfig
connectorProvider toorg.glassfish.jersey.jdk.connector.JdkConnectorProvider
instead of letting jersey use the defaultHttpUrlConnectorProvider
.Because of our local network security all of our on-prem docker containers must use a http/s proxy to connect to the internet. All requests from the docker container from the container host is blocked. Our gitlab CI script that we use to deploy our scripts is provided in [i]. Investigating the issues further, we found out that the JdkConnectorProvider does not support http/s proxies which are set via the
https.proxyHost
andhttps.proxyPort
arguments. The jstack call stack of the problem is provided in [ii].I've tested the following jersey Connector implementation's bellow in [iii], which are supported by jersey (https://eclipse-ee4j.github.io/jersey.github.io/documentation/latest/appendix-properties.html).
jersey.config.client.proxy.uri
URI of a HTTP proxy the client connector should use. Default value is not set. Currently supported with ApacheConnectorProvider, Apache5ConnectorProvider, GrizzlyConnectorProvider, HelidonConnectorProvider, NettyConnectorProvider, and JettyConnectorProvider only.
How-ever, due to them modifying the http headers it results in a http response of 400 from cloudhub with the message
org.jvnet.mimepull.MIMEParsingException: Missing start boundary.
. This is also reported by other projects such as (https://github.com/eclipse-ee4j/jersey/issues/5094).To solve our deployment problem I've removed the offending line
configuration.connectorProvider(new org.glassfish.jersey.jdk.connector.JdkConnectorProvider());
from the (mule-maven-plugin\mule-deployer\src\main\java\org\mule\tools\client\core\AbstractClient.java
), and deployed a quickfix mule-maven-plugin 4.1.0-SNAPSHOT version to our gitlab repository, which has resolved the issue. But this isn't really a long term solution.[iii] jersey Connector implementation's ApacheConnectorProvider GrizzlyConnectorProvider JettyConnectorProvider NettyConnectorProvider
[i] Gitlab .gitlab-ci.yml container script.
[ii] Jstack when using the JdkConnectorProvider.