-
Notifications
You must be signed in to change notification settings - Fork 463
Add mtls support for proxy connections #2427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
WalkthroughThe OAuthClient's HTTP client construction and SSL handling underwent a comprehensive refactor, consolidating multiple legacy paths into a unified flow with explicit SSL context resolution, hostname verification, and proxy configuration support. Changes
Sequence Diagram(s)sequenceDiagram
actor caller as Caller
participant oauth as OAuthClient
participant builder as ClientConnFactoryBuilder
participant ssl as SSLContext
participant verifier as HostnameVerifier
participant connMgr as ConnectionManager
participant client as HttpClient
caller->>oauth: getSecureClient(url, config)
oauth->>builder: read SSL config from Axis2
builder->>ssl: create SSLContext with default fallback
ssl-->>oauth: SSLContext
oauth->>oauth: select HostnameVerifier based on system properties
oauth->>verifier: create verifier instance (DefaultAndLocalhost or standard)
verifier-->>oauth: HostnameVerifier
oauth->>oauth: create SSLConnectionSocketFactory(SSLContext, verifier)
oauth->>oauth: build Registry for HTTP/HTTPS
alt proxy enabled
oauth->>connMgr: create PoolingHttpClientConnectionManager
else no proxy
oauth->>connMgr: create BasicHttpClientConnectionManager
end
connMgr-->>oauth: ConnectionManager
oauth->>oauth: wire SSL socket factory into ConnectionManager
oauth->>oauth: apply RequestConfig (includeProxy if needed)
oauth->>client: build HttpClient with ConnectionManager + RequestConfig
client-->>oauth: HttpClient
oauth-->>caller: secure HttpClient
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
modules/core/src/main/java/org/apache/synapse/endpoints/auth/oauth/OAuthClient.java (1)
249-339: TrustStoreConfigs regression breaks custom TLS/mTLS setups
getSecureClient(..., trustStoreConfigs)no longer consumes thetrustStoreConfigsargument, even though the public overload exists precisely to let callers supply endpoint-specific key/trust material. After this refactor those credentials are silently ignored, so any deployment that relied on that hook (including the newly advertised mTLS-over-proxy scenario) will fail the TLS handshake. Please reinstate the logic that mergestrustStoreConfigsinto theSSLContextbefore you build theSSLConnectionSocketFactory—load the provided key/trust stores and layer them over the Axis2 defaults so the client certificate and custom trust anchors are honored.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
modules/core/src/main/java/org/apache/synapse/endpoints/auth/oauth/OAuthClient.java(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
modules/core/src/main/java/org/apache/synapse/endpoints/auth/oauth/OAuthClient.java
Show resolved
Hide resolved
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Purpose
Summary by CodeRabbit