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

8217633: Configurable extensions with system properties #1752

Closed
wants to merge 6 commits into from

Conversation

XueleiFan
Copy link
Member

@XueleiFan XueleiFan commented Dec 11, 2020

The TLS protocols are designed to tolerant unknown TLS extensions. However, although it is not common, there are a few TLS implementations that cannot handle unknown extensions properly. As results in unexpected interoperability issue when new extensions are introduced in JDK. The interoperability impact could be mitigated If applications can customize the extensions if needed.

With this update, two system properties are added to configure the default extensions in either client or server side of TLS connections. Please note that the impact of blocking TLS extensions is complicated. For example, a TLS connection may not be able to established if a mandatory extension is blocked. Please don't use this feature unless you clearly understand the impact.

Bug: https://bugs.openjdk.java.net/browse/JDK-8217633
CSR: https://bugs.openjdk.java.net/browse/JDK-8217993


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8217633: Configurable extensions with system properties

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/1752/head:pull/1752
$ git checkout pull/1752

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 11, 2020

👋 Welcome back xuelei! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 11, 2020
@openjdk
Copy link

openjdk bot commented Dec 11, 2020

@XueleiFan The following label will be automatically applied to this pull request:

  • security

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the security security-dev@openjdk.org label Dec 11, 2020
@mlbridge
Copy link

mlbridge bot commented Dec 11, 2020

Webrevs

@XueleiFan
Copy link
Member Author

/csr needed

@openjdk openjdk bot added the csr Pull request needs approved CSR before integration label Dec 11, 2020
@openjdk
Copy link

openjdk bot commented Dec 11, 2020

@XueleiFan this pull request will not be integrated until the CSR request JDK-8217993 for issue JDK-8217633 has been approved.

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 9, 2021

@XueleiFan This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@XueleiFan
Copy link
Member Author

ping ...

Copy link
Contributor

@RogerRiggs RogerRiggs left a comment

Choose a reason for hiding this comment

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

Where will the new properties be documented?

In the CSR, it may be worth mentioning that the extension names are case sensitive.

@XueleiFan
Copy link
Member Author

Where will the new properties be documented?

Yes. The properties will be described in the JSSE Reference Guide. I added a "Documentation" section in the CSR.

In the CSR, it may be worth mentioning that the extension names are case sensitive.
Good point.

Thanks for the review.

@@ -0,0 +1,75 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.

(new BlockedExtension(new String[] {args[1]})).run();
} catch (SSLException | IllegalStateException ssle) {
if (shouldSuccess) {
throw new Exception(
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
throw new Exception(
throw new RuntimeException(

}

if (!shouldSuccess) {
throw new Exception(
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
throw new Exception(
throw new RuntimeException(

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catches, the years should be 2021 now. Thanks!

Copy link
Member

@jnimeh jnimeh left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@mlbridge
Copy link

mlbridge bot commented Jan 26, 2021

Mailing list message from Bernd Eckenfels on security-dev:

Hello,

I wanted to mention again, that all those System property configurations are good, especially to resolve the update pains, but not really useful if you want to make configurations on a per-connection base. If you have to support multiple partners it can be a real pain to setup a common feature set or multiple instances. For this a generic feature setter for the context would be really useful. Most prominent recent example is the ca-extension, which only really makes sense if you also did programmatically configure a small list of trusted CAs.

I also think it would overall clean up the code and give a good place for Javadoc all those options.
Not to mention the default could be tied to a few new context names.

Gruss
Bernd
--
http://bernd.eckenfels.net
________________________________
Von: security-dev <security-dev-retn at openjdk.java.net> im Auftrag von Xue-Lei Andrew Fan <xuelei at openjdk.java.net>
Gesendet: Monday, January 25, 2021 11:17:56 PM
An: security-dev at openjdk.java.net <security-dev at openjdk.java.net>
Betreff: Re: RFR: 8217633: Configurable extensions with system properties [v2]

The TLS protocols are designed to tolerant unknown TLS extensions. However, although it is not common, there are a few TLS implementations that cannot handle unknown extensions properly. As results in unexpected interoperability issue when new extensions are introduced in JDK. The interoperability impact could be mitigated If applications can customize the extensions if needed.

With this update, two system properties are added to configure the default extensions in either client or server side of TLS connections. Please note that the impact of blocking TLS extensions is complicated. For example, a TLS connection may not be able to established if a mandatory extension is blocked. Please don't use this feature unless you clearly understand the impact.

Bug: https://bugs.openjdk.java.net/browse/JDK-8217633
CSR: https://bugs.openjdk.java.net/browse/JDK-8217993

Xue-Lei Andrew Fan has updated the pull request incrementally with one additional commit since the last revision:

Update copyright years to 2021

-------------

Changes:
- all: https://git.openjdk.java.net/jdk/pull/1752/files
- new: https://git.openjdk.java.net/jdk/pull/1752/files/ad5f3330..5bd6e86

Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk&pr=1752&range=01
- incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=1752&range=00-01

Stats: 4 lines in 2 files changed: 0 ins; 0 del; 4 mod
Patch: https://git.openjdk.java.net/jdk/pull/1752.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/1752/head:pull/1752

PR: https://git.openjdk.java.net/jdk/pull/1752
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/security-dev/attachments/20210126/5f676ee3/attachment.htm>

@XueleiFan
Copy link
Member Author

Hi Bernd,

I agree with you that System property is not as useful to configure individual connections. It is mostly used for corner cases that have interoperability or compatibility issues. A general program should use APIs and the default system properties.

Mailing list message from Bernd Eckenfels on security-dev:

Hello,

I wanted to mention again, that all those System property configurations are good, especially to resolve the update pains, but not really useful if you want to make configurations on a per-connection base. If you have to support multiple partners it can be a real pain to setup a common feature set or multiple instances. For this a generic feature setter for the context would be really useful. Most prominent recent example is the ca-extension, which only really makes sense if you also did programmatically configure a small list of trusted CAs.

Yes, ca-extension is an item I was thinking of to support in JDK.

I also think it would overall clean up the code and give a good place for Javadoc all those options.
Not to mention the default could be tied to a few new context names.

Currently, the system properties are documented in the JSSE Reference Guides. But just as you know, it is as easy to follow. I agree with you that it would be nice to have better place to have them all together.

Thank you for the review.

Regards,
Xuelei

Gruss
Bernd

http://bernd.eckenfels.net

@openjdk openjdk bot removed the csr Pull request needs approved CSR before integration label Jan 29, 2021
@openjdk
Copy link

openjdk bot commented Jan 29, 2021

@XueleiFan This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8217633: Configurable extensions with system properties

Reviewed-by: rhalade, jnimeh

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 23 new commits pushed to the master branch:

  • 1519632: 8251462: Simplify compilation policy
  • 71128cf: 8260586: Shenandoah: simplify "Concurrent Weak References" logging
  • 81e9e6a: 8260461: Modernize jsr166 tck tests
  • 2b166d8: 8260596: Comment cleanup in BigInteger
  • 1de3c55: 8260584: Shenandoah: simplify "Concurrent Thread Roots" logging
  • bbbfaa5: 8249262: Initialize InstanceKlass::_package_entry during CDS dump time
  • 3aabbd7: 8260432: allocateSpaceForGP in freetypeScaler.c might leak memory
  • abc4300: 8257746: Regression introduced with JDK-8250984 - memory might be null in some machines
  • 13ca433: 8259628: jdk/net/ExtendedSocketOption/AsynchronousSocketChannelNAPITest.java fails intermittently
  • baf46ba: 8259801: Enable XML Signature secure validation mode by default
  • ... and 13 more: https://git.openjdk.java.net/jdk/compare/7030d2e026dceab82d795646dff357210aa54061...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 29, 2021
@XueleiFan
Copy link
Member Author

/integrate

@openjdk openjdk bot closed this Jan 30, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated labels Jan 30, 2021
@openjdk openjdk bot removed the rfr Pull request is ready for review label Jan 30, 2021
@openjdk
Copy link

openjdk bot commented Jan 30, 2021

@XueleiFan Since your change was applied there have been 37 commits pushed to the master branch:

  • f5ca838: 8065773: JDI: UOE is not thrown, when redefineClasses changes a class modifier
  • 739bbd0: 8260566: Pattern type X is a subtype of expression type Y message is incorrect
  • b2e582a: 8259905: Compiler treats 'sealed' keyword as 'var' keyword
  • 6415d3b: 8259584: SuperWord::fix_commutative_inputs checks in_bb(fin1) instead of in_bb(fin2)
  • b7b391b: 8260625: Rename MetaspaceExpand_lock
  • 22bfa5b: 8255837: Shenandoah: Remove ShenandoahConcurrentRoots class
  • 53f1b93: 8260518: Change default -mmacosx-version-min to 10.12
  • 24a2621: 8260592: jpackage tests fail when Desktop is not supported
  • d2b0ea1: 8260282: Add option to compress heap dumps created by -XX:+HeapDumpOnOutOfMemoryError
  • a5fb517: 8259404: Shenandoah: Fix time tracking in parallel_cleaning
  • ... and 27 more: https://git.openjdk.java.net/jdk/compare/7030d2e026dceab82d795646dff357210aa54061...master

Your commit was automatically rebased without conflicts.

Pushed as commit 71bfe96.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@XueleiFan XueleiFan deleted the JDK-8217633 branch January 30, 2021 00:26
@mdameda
Copy link

mdameda commented Feb 2, 2023

Hi @XueleiFan , i don't find this patch into latest OpenJDK 1.8 releases . Is there a plan to integrate this patch also into OpenJDK 1.8 ? (i see that OracleJDK 1.8 was updated)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated security security-dev@openjdk.org
5 participants