Skip to content

20.2: Document Java TLS error #7820

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

Closed
bdarnell opened this issue Jul 30, 2020 · 7 comments
Closed

20.2: Document Java TLS error #7820

bdarnell opened this issue Jul 30, 2020 · 7 comments
Assignees
Labels
C-doc-improvement O-eng P-1 High priority; must be done this release T-missing-info
Milestone

Comments

@bdarnell
Copy link
Contributor

bdarnell commented Jul 30, 2020

Ben Darnell (bdarnell) commented:

Certain older versions of Java may get the error javax.net.ssl.SSLHandshakeException: extension (5) should not be presented in certificate_request when connecting to CockroachDB 20.2 (the issue is new in that version because we are supporting TLS 1.3 by default). We should document this, saying something like:

CockroachDB 20.2 is incompatible with some releases of Java, including OpenJDK 11 versions older than 11.0.7 and OpenJDK 13 versions older than 13.0.3. The recommended solution is to upgrade to the latest JDK release in a given branch. If that is not possible, as a workaround you can add the flag -Djdk.tls.client.protocols=TLSv1.2 when running the Java client processes.

This issue is the successor to #7258

Jira Issue: DOC-600

@rafiss
Copy link
Contributor

rafiss commented Aug 12, 2020

If that is not possible, as a workaround you can add the flag -Djdk.tls.client.protocols=TLSv1.2 when running the Java client processes.

I'm a bit confused by this. Shouldn't the setting be -Djdk.tls.client.protocols=TLSv1.3, since CockroachDB 20.2 uses TLS 1.3 by default?

@bdarnell
Copy link
Contributor Author

CRDB and java both support both TLS 1.2 and 1.3. By default TLS will negotiate the highest version supported by both client and server, i.e. 1.3. But java's TLS 1.3 implementation has a bug (in certain releases) that makes it incompatible with Go's implementation of TLS 1.3, so we use -Djdk.tls.client.protocols=TLSv1.2 to disable TLS 1.3.

@ericharmeling
Copy link
Contributor

@taroface

This PR might fix this issue: #7988

Not sure where else you were planning to document this workaround.

@taroface
Copy link
Contributor

@ericharmeling I think that PR mostly fixes the issue, but we may want to cite the specific error and add this to a troubleshooting document somewhere. I can handle that as part of this issue.

Thank you!

@taroface taroface added this to the 20.2 milestone Aug 13, 2020
@taroface taroface added the P-1 High priority; must be done this release label Aug 13, 2020
@bdarnell
Copy link
Contributor Author

A correction to #7988:

CockroachDB versions v20.1 and lower require TLS 1.2. By default, Java 8 uses TLS 1.2, but applications running on Java 9+ must be configured to run TLS 1.2. For example, when starting your app, use: $ java -Djdk.tls.client.protocols=TLSv1.2 appName

This isn't quite right: Newer versions of java must be configured to use TLS 1.2 when the server also supports TLS 1.3. No callout is necessary for CockroachDB 20.1 and older (because they don't support TLS 1.3 at all); everything will just work.

@ericharmeling
Copy link
Contributor

Thanks @bdarnell!

See #8010 for the fix.

@rafiss
Copy link
Contributor

rafiss commented Aug 25, 2021

It seems like this issue is closeable now. Is there anything else to be done?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-doc-improvement O-eng P-1 High priority; must be done this release T-missing-info
Projects
None yet
Development

No branches or pull requests

6 participants