Re: java.net.Socket should report the attempted address and port

2018-06-19 Thread Alan Bateman
On 19/06/2018 10:30, Michael McMahon wrote: Hi, There is an updated webrev for this at: http://cr.openjdk.java.net/~michaelm/8204233/webrev.2/ I'd like to get this into 11 and it needs a CSR to approve the property name change. So, hopefully it can be reviewed quickly. A coin toss as to whethe

Re: java.net.Socket should report the attempted address and port

2018-06-19 Thread Michael McMahon
Hi, There is an updated webrev for this at: http://cr.openjdk.java.net/~michaelm/8204233/webrev.2/ I'd like to get this into 11 and it needs a CSR to approve the property name change. So, hopefully it can be reviewed quickly. Thanks, Michael On 18/06/2018, 13:15, Michael McMahon wrote: Hi al

Re: java.net.Socket should report the attempted address and port

2018-06-18 Thread Alan Bateman
On 18/06/2018 13:15, Michael McMahon wrote: Hi all, I agree with Sean's suggestion below that a multi-valued property captures the generality in the name and the specific case implemented here with the value "hostInfo". So, how about exactly as suggested: property name - "jdk.net.includeInExc

Re: java.net.Socket should report the attempted address and port

2018-06-18 Thread Michael McMahon
Hi all, I agree with Sean's suggestion below that a multi-valued property captures the generality in the name and the specific case implemented here with the value "hostInfo". So, how about exactly as suggested: property name - "jdk.net.includeInExceptions" with possible value limited to "hostinf

Re: java.net.Socket should report the attempted address and port

2018-06-15 Thread Sean Mullan
Hi Michael, I agree with Alan and Peter that the name should more clearly identify the security implications of setting it. Alternatively, if you think you may build on this you might want to add support for a multi-valued property, like jdk.net.includeInExceptions=hostInfo,... --Sean On

Re: java.net.Socket should report the attempted address and port

2018-06-15 Thread Alan Bateman
On 15/06/2018 11:53, Péter Gergely Horváth wrote: Hi Michael, I am wondering if the property name could be maybe improved: 1.) The prefix "jdk" does not seem to match the naming convention that of the existing networking properties [1], where for example prefix "java.net "

Re: java.net.Socket should report the attempted address and port

2018-06-15 Thread Péter Gergely Horváth
Hi Michael, I am wondering if the property name could be maybe improved: 1.) The prefix "jdk" does not seem to match the naming convention that of the existing networking properties [1], where for example prefix "java.net" is used for "java.net.preferIPv4Stack" 2.) I agree with Alan that the curr

Re: java.net.Socket should report the attempted address and port

2018-06-14 Thread Michael McMahon
Hi Alan, Thanks for looking at it. On 14/06/2018, 18:10, Alan Bateman wrote: On 06/06/2018 08:45, Michael McMahon wrote: Hi all, Finally to return to this topic. We have looked at a few different approaches and it seems the best way is to define a security property that can be set in the ja

Re: java.net.Socket should report the attempted address and port

2018-06-14 Thread Alan Bateman
On 06/06/2018 08:45, Michael McMahon wrote: Hi all, Finally to return to this topic. We have looked at a few different approaches and it seems the best way is to define a security property that can be set in the java.security configuration file, but which can be overridden as a system property

Re: java.net.Socket should report the attempted address and port

2018-06-08 Thread Michael McMahon
Jaikiran Thanks for the review and the two comments. You're right the close() was omitted by mistake. On the initialization of the system property, I would think that caching in a static final is very common for such properties and I'm not aware of that being explicitly documented anywhere. B

Re: java.net.Socket should report the attempted address and port

2018-06-07 Thread Jaikiran Pai
Also one other minor detail - given that this system property value is read onceand cached as a static final, would it make sense to include a note (in the property description of the java.security file?) that explicitly states that this property needs to be set while launching Java and can't b

Re: java.net.Socket should report the attempted address and port

2018-06-07 Thread Jaikiran Pai
Hi Michael, I'm not a reviewer. I just checked the webrev and saw this change: --- old/src/java.base/share/classes/java/net/AbstractPlainSocketImpl.java 2018-06-06 08:34:38.0 +0100 +++ new/src/java.base/share/classes/java/net/AbstractPlainSocketImpl.java 2018-06-06 08:34:3

Re: java.net.Socket should report the attempted address and port

2018-06-06 Thread Michael McMahon
Hi all, Finally to return to this topic. We have looked at a few different approaches and it seems the best way is to define a security property that can be set in the java.security configuration file, but which can be overridden as a system property. The current behavior will remain the defaul

Re: java.net.Socket should report the attempted address and port

2018-05-02 Thread Péter Gergely Horváth
Hi Michael, Thank you for looking into this issue. I believe it would be a valuable improvement that would help a lot of people out there. Please let me know if there is any way I can help you. Thanks, Peter On Tue, May 1, 2018 at 10:48 AM, Michael McMahon < michael.x.mcma...@oracle.com> wrote

Re: java.net.Socket should report the attempted address and port

2018-05-01 Thread Michael McMahon
Peter, Just to followup on this. We are still investigating a few options for doing this and it might be a few more weeks before we get a decision. I did take your patch as a starting point, and modified it to also work with NIO, and also to preserve the original exception (with original stack

Re: java.net.Socket should report the attempted address and port

2018-04-23 Thread Michael McMahon
I agree we should do something about this. I will make some enquiries with the security folks here as to what might be permitted. I suspect either some kind of debugging property/switch to enable it, or the limited information only being provided when a security manager is enabled, might work.

Re: java.net.Socket should report the attempted address and port

2018-04-23 Thread Péter Gergely Horváth
Hi Tobias, Thank you for pointing me to that thread: it's good to have that context (it was sent before I joined the mailing list, so please bear with me). I understand the JDK developers want to be safe than sorry around reporting target addresses and I absolutely agree with that point. However

Re: java.net.Socket should report the attempted address and port

2018-04-22 Thread James Roper
This would be especially useful in asynchronous applications - since in those cases the exception rarely maps back to a place in user code that would indicate what is being connected to. As someone who has spent a lot of time supporting developers who use asynchronous libraries and post exceptions

java.net.Socket should report the attempted address and port

2018-04-22 Thread Péter Gergely Horváth
Hi All, I am wondering if it would be possible to make a minor improvement to the way *java.net.Socket* reports connectivity errors and incorporate the attempted address, port and the timeout used into the exception message. The current implementation emits a generic error message, which is not t