micro-integrator icon indicating copy to clipboard operation
micro-integrator copied to clipboard

Evaluating the possibility of changing the backend certificates depend on the request information

Open chanikag opened this issue 1 year ago • 2 comments

Problem

This issue created to evaluate the possibility of selecting the backend certificates for single backend depends on the request data coming from their client applications.

Ex: If the incoming request contains the element <code>1<code> we have to invoke the remote service https://remote.host/soap with the client certifkatce1, if the incoming request contains the element <code>2<code> we have to invoke the remote service https://remote.host/soap (same backend service) with the client certifkatce2 and so on.

Proposed Solution

.

Alternatives

No response

Version

No response

chanikag avatar Apr 21 '25 07:04 chanikag

Update:

In order to implement this fix we need to extract the request ID separately at the request flow when creating connection at [1], but the flow is directed to above code space directly from ClientIODispatch, where at that place we don't have the message context to extract request identifier.

Solution: Introduce request Identifier to the HostConnections[2] and pass it when creating the connection. Maintain the requestID as well in the connection pool.

[1] - https://github.com/wso2/wso2-synapse/blob/master/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/http/conn/ClientConnFactory.java#L132 [2] https://github.com/wso2/wso2-synapse/blob/master/modules/transports/core/nhttp/src/main/java/org/apache/synapse/transport/passthru/ClientIODispatch.java#L56

chanikag avatar Apr 25 '25 07:04 chanikag

PR: https://github.com/wso2/wso2-synapse/pull/2355

chanikag avatar Apr 29 '25 09:04 chanikag

Closing since the fix is merged.

RDPerera avatar Jun 27 '25 04:06 RDPerera