Skip to content

Commit e0ee196

Browse files
authored
Update development (#814)
2 parents 27faac7 + 15430c9 commit e0ee196

6 files changed

Lines changed: 19 additions & 15 deletions

File tree

CHANGES.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
5.4.0 (Sep 12, 2025)
2+
- Added new configuration for Fallback Treatments, which allows setting a treatment value and optional config to be returned in place of "control", either globally or by flag. Read more in our docs.
3+
- Added ProxyConfiguration parameter to support proxies, including Harness Forward Proxy, allowing also for more secured authentication options: MTLS, Bearer token and user/password authentication. Read more in our docs.
4+
15
5.3.2 (Aug 20, 2025)
26
- Fixed issue with uncaught exception on flags preloading.
37

build.gradle

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ apply from: 'spec.gradle'
1919
apply from: 'jacoco.gradle'
2020

2121
ext {
22-
splitVersion = '5.4.0-rc1'
22+
splitVersion = '5.4.0'
2323
jacocoVersion = '0.8.8'
2424
}
2525

@@ -284,6 +284,3 @@ tasks.withType(Test) {
284284
forkEvery = 100
285285
maxHeapSize = "1024m"
286286
}
287-
288-
289-

src/main/java/io/split/android/client/network/HttpClientImpl.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ public class HttpClientImpl implements HttpClient {
7171
mSslSocketFactory = sslSocketFactory;
7272
mUrlSanitizer = urlSanitizer;
7373
mCertificateChecker = certificateChecker;
74-
mConnectionHandler = mHttpProxy != null && mSslSocketFactory != null &&
75-
(mHttpProxy.getCaCertStream() != null || mHttpProxy.getClientCertStream() != null) ?
74+
mConnectionHandler = mHttpProxy != null && mSslSocketFactory != null ?
7675
new ProxyCacertConnectionHandler() : null;
7776
}
7877

@@ -339,6 +338,9 @@ private SSLSocketFactory createSslSocketFactoryFromProxy(HttpProxy proxyParams)
339338
if (caCertBytes != null) {
340339
return factoryProvider.create(new ByteArrayInputStream(caCertBytes));
341340
}
341+
} else {
342+
// No custom auth path
343+
return factoryProvider.create(null);
342344
}
343345
} catch (Exception e) {
344346
Logger.e("Failed to create SSLSocketFactory for proxy: " + proxyParams.getHost() + ", error: " + e.getMessage());

src/main/java/io/split/android/client/network/HttpRequestHelper.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ static HttpURLConnection createConnection(@NonNull URL url,
3232
@Nullable ProxyCredentialsProvider proxyCredentialsProvider,
3333
@Nullable String body) throws IOException {
3434

35-
if (httpProxy != null && sslSocketFactory != null && (httpProxy.getCaCertStream() != null || httpProxy.getClientCertStream() != null)) {
35+
// Use the new tunnel path only when there is no legacy authenticator present.
36+
// If a legacy authenticator proxy, we prefer the legacy path to preserve 407 retry behavior.
37+
if (httpProxy != null && sslSocketFactory != null && !httpProxy.isLegacy()) {
3638
try {
3739
HttpResponse response = mConnectionHandler.executeRequest(
3840
httpProxy,
@@ -60,12 +62,11 @@ private static HttpURLConnection openConnection(@Nullable Proxy proxy,
6062
@NonNull HttpMethod method,
6163
@NonNull Map<String, String> headers,
6264
boolean useProxyAuthentication) throws IOException {
63-
64-
// Check if we need custom SSL proxy handling
65-
if (httpProxy != null && (httpProxy.getCaCertStream() != null || httpProxy.getClientCertStream() != null)) {
65+
66+
if (httpProxy != null && !httpProxy.isLegacy() && (httpProxy.getCaCertStream() != null || httpProxy.getClientCertStream() != null)) {
6667
throw new IOException("SSL proxy scenarios require custom handling - use executeRequest method instead");
6768
}
68-
69+
6970
// Standard HttpURLConnection proxy handling
7071
HttpURLConnection connection;
7172
if (proxy != null) {

src/main/java/io/split/android/client/network/HttpStreamRequestImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private void closeBufferedReader() {
123123
private HttpStreamResponse getRequest() throws HttpException, IOException {
124124
HttpStreamResponse response;
125125
try {
126-
if (mConnectionHandler != null && mHttpProxy != null && mSslSocketFactory != null && (mHttpProxy.getCaCertStream() != null || mHttpProxy.getClientCertStream() != null)) {
126+
if (mConnectionHandler != null && mHttpProxy != null && mSslSocketFactory != null) {
127127
response = mConnectionHandler.executeStreamRequest(mHttpProxy, getUrl(), mHttpMethod, mHeaders, mSslSocketFactory, mProxyCredentialsProvider);
128128
} else {
129129
mConnection = setUpConnection(false);

src/test/java/io/split/android/client/network/HttpClientTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ public MockResponse dispatch(RecordedRequest request) {
281281
HttpClient client = new HttpClientImpl.Builder()
282282
.setContext(mock(Context.class))
283283
.setUrlSanitizer(mUrlSanitizerMock)
284-
.setProxy(HttpProxy.newBuilder(mProxyServer.getHostName(), mProxyServer.getPort()).build())
284+
.setProxy(HttpProxy.newBuilder(mProxyServer.getHostName(), mProxyServer.getPort()).buildLegacy())
285285
.build();
286286

287287
HttpRequest request = client.request(mWebServer.url("/test1/").uri(), HttpMethod.GET);
@@ -325,7 +325,7 @@ public SplitAuthenticatedRequest authenticate(@NonNull SplitAuthenticatedRequest
325325
return request;
326326
}
327327
})
328-
.setProxy(HttpProxy.newBuilder(mProxyServer.getHostName(), mProxyServer.getPort()).build())
328+
.setProxy(HttpProxy.newBuilder(mProxyServer.getHostName(), mProxyServer.getPort()).buildLegacy())
329329
.build();
330330

331331
HttpRequest request = client.request(mWebServer.url("/test1/").uri(), HttpMethod.GET);
@@ -380,7 +380,7 @@ public SplitAuthenticatedRequest authenticate(@NonNull SplitAuthenticatedRequest
380380
return request;
381381
}
382382
})
383-
.setProxy(HttpProxy.newBuilder(mProxyServer.getHostName(), mProxyServer.getPort()).build())
383+
.setProxy(HttpProxy.newBuilder(mProxyServer.getHostName(), mProxyServer.getPort()).buildLegacy())
384384
.build();
385385

386386
HttpRequest request = client.request(mWebServer.url("/test1/").uri(), HttpMethod.POST, "{}");

0 commit comments

Comments
 (0)