Skip to content
This repository was archived by the owner on Jan 18, 2021. It is now read-only.

Conversation

@jroitgrund
Copy link
Contributor

Fixes the following breakage on consumers:

java.lang.UnsupportedOperationException: clientBuilder.sslSocketFactory(SSLSocketFactory) not supported on JDK 9+
	at okhttp3.internal.platform.Jdk9Platform.trustManager(Jdk9Platform.java:81)
	at okhttp3.internal.platform.Platform.buildCertificateChainCleaner(Platform.java:176)
	at okhttp3.OkHttpClient$Builder.sslSocketFactory(OkHttpClient.java:768)

@jroitgrund jroitgrund force-pushed the java-11-compatibility branch from f474959 to e5c3630 Compare March 15, 2019 16:57
@jroitgrund
Copy link
Contributor Author

Woops, hadn't noticed #8 ! Mine builds though.

@uschi2000 uschi2000 merged commit 7ed8ef1 into palantir:develop Mar 19, 2019
@uschi2000 uschi2000 mentioned this pull request Mar 19, 2019
public HttpPollingResource(Optional<SSLSocketFactory> socketFactory, Collection<String> pollRequests,
int numAttempts, long intervalMillis, int connectionTimeoutMillis, int readTimeoutMillis) {
public HttpPollingResource(
Optional<SslParameters> sslParameters,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This SSLSocketFactory -> SslParameters change broke Java API and means automatic PRs don't go in without manual attention :/

do you mind if I bring back the backcompat thing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, I didn't realize that the constructor was also public - I thought only the static factory was.

Copy link
Contributor Author

@jroitgrund jroitgrund Mar 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is the two constructors (Optional<SslParameters> and Optional`) can't be overloaded, because they have the same erasure. To reintroduce the old constructor, we'd have to break people who moved to the new constructor. Happy to raise a PR to do this if you think it's better.

Copy link
Contributor

@iamdanfox iamdanfox Mar 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep I think bringing back the old constructor is the right approach here. There are tons of usages of 0.4.0 but since 0.5.0 has only been released for a couple of days (and didn't auto upgrade) I think it's ok to call this a 'fix'.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#13

this.x509TrustManager = x509TrustManager;
}

private static SslParameters of(SSLSocketFactory sslSocketFactory) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this one private but the other public?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants