Skip to content

Commit 351174a

Browse files
committed
Enforce modern TLS1.2+
This fixes the following problem: Bandcamp/their Fastly CDN fails with 403 responses when running tests * on Windows * with Java 17+ * and OkHttp's APPROVED_CIPHER_SUITES (default) are used
1 parent 12e2145 commit 351174a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

extractor/src/test/java/org/schabi/newpipe/downloader/DownloaderTestImpl.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
import org.schabi.newpipe.extractor.exceptions.ReCaptchaException;
88

99
import java.io.IOException;
10+
import java.util.Arrays;
1011
import java.util.List;
1112
import java.util.Map;
1213
import java.util.concurrent.TimeUnit;
1314

1415
import javax.annotation.Nonnull;
1516
import javax.annotation.Nullable;
1617

18+
import okhttp3.ConnectionSpec;
1719
import okhttp3.OkHttpClient;
1820
import okhttp3.RequestBody;
1921
import okhttp3.ResponseBody;
@@ -28,8 +30,13 @@ public final class DownloaderTestImpl extends Downloader {
2830
private final RateLimitedClientWrapper clientWrapper;
2931

3032
private DownloaderTestImpl(final OkHttpClient.Builder builder) {
31-
this.clientWrapper = new RateLimitedClientWrapper(
32-
builder.readTimeout(30, TimeUnit.SECONDS).build());
33+
this.clientWrapper = new RateLimitedClientWrapper(builder
34+
.readTimeout(30, TimeUnit.SECONDS)
35+
// Required for certain services
36+
// For example Bandcamp otherwise fails on Windows with Java 17+
37+
// as their Fastly-CDN returns 403
38+
.connectionSpecs(Arrays.asList(ConnectionSpec.RESTRICTED_TLS))
39+
.build());
3340
}
3441

3542
/**

0 commit comments

Comments
 (0)