Skip to content
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

Cherry pick jdk17 modules fix onto 4.9.x #6742

Merged
merged 1 commit into from
Jul 17, 2021

Conversation

yschimke
Copy link
Collaborator

@yschimke yschimke commented Jul 4, 2021

No description provided.

@yschimke
Copy link
Collaborator Author

yschimke commented Jul 4, 2021

Probably needs a confirmed test on 5.x before we land on 4.9.x

@yschimke yschimke marked this pull request as ready for review July 17, 2021 13:36
@yschimke
Copy link
Collaborator Author

No easy way to test this yet. This test passes with or without the fix.

package okhttp3;

import org.junit.jupiter.api.Test;

import javax.net.ssl.SSLSocketFactory;

import static org.junit.jupiter.api.Assertions.assertEquals;

public class Jdk17Test {
    @Test
    public void testDeprecatedSslSocketFactory() {
        // https://github.com/square/okhttp/issues/6694

        SSLSocketFactory factory = (SSLSocketFactory) SSLSocketFactory.getDefault();

        try {
            new OkHttpClient.Builder().sslSocketFactory(factory).build();
        } catch (UnsupportedOperationException uoe) {
            // expected
            assertEquals("clientBuilder.sslSocketFactory(SSLSocketFactory) not supported on " +
                    "JDK 8 (>= 252) or JDK 9+",
                    uoe.getMessage());
        }
    }
}

@yschimke yschimke merged commit 262b3cd into square:okhttp_4.9.x Jul 17, 2021
@yschimke yschimke deleted the jdk17modules branch January 6, 2022 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants