[9] RFR: 8157107: HTTP/2 client may fail with NPE if additional logging enabled

Artem Smotrakov artem.smotrakov at oracle.com
Tue May 17 21:27:42 UTC 2016


Hello,

Please review this patch for 9.

NPE may occur if additional logging is enabled with 
"java.net.http.HttpClient.log" system property because 
AsyncSSLDelegate.logParams(SSLParameters) doesn't check for null values 
which were returned by SSLParameters instance.

I also noticed that setting "java.net.http.HttpClient.log" system 
property to "all" doesn't enable additional logging for "ssl". Not sure 
if that was done for some purpose.

Changes:
- added a couple of checks to AsyncSSLDelegate.logParams(SSLParameters) 
method to prevent NPEs
- updated java/net/http/Log.java to enable logging for "ssl" if 
"java.net.http.HttpClient.log" system property was set to "all"
- updated java/net/http/Http2TestServer.java to implement AutoCloseable, 
so that it's possible to use it in try-with-resource blocks (which 
simplifies tests a little bit)
- added TLSConnection.java test which run HTTP/2 client with different 
SSL parameters, and checks that they were actually used
- a couple of cosmetic changes (unused imports, etc)

TLSConnection.java test also checks that 
https://bugs.openjdk.java.net/browse/JDK-8150769 was fixed (this bug has 
been fixed while HTTP/2 integration).

Bug: https://bugs.openjdk.java.net/browse/JDK-8157107
Webrev: http://cr.openjdk.java.net/~asmotrak/8157107/webrev.01/

Artem
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/net-dev/attachments/20160517/592a74fc/attachment.html>


More information about the net-dev mailing list