Bug 31626 - javax.net.SocketFactory#createSocket() throws UnsupportedOperationException
Summary: javax.net.SocketFactory#createSocket() throws UnsupportedOperationException
Status: RESOLVED FIXED
Alias: None
Product: classpath
Classification: Unclassified
Component: crypto (show other bugs)
Version: unspecified
: P3 normal
Target Milestone: 0.95
Assignee: Casey Marshall
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-18 18:44 UTC by Andrew Overholt
Modified: 2019-06-15 00:09 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-04-18 20:47:24


Attachments
test case (168 bytes, text/plain)
2007-04-18 20:47 UTC, Tom Tromey
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Overholt 2007-04-18 18:44:20 UTC
Mylar (eclipse.org/mylar) makes use of this method.  I've patched around it for now, but it would be nice if we didn't have to.  At the very least, I wanted a bug report to justify my patch :)
Comment 1 Tom Tromey 2007-04-18 20:47:11 UTC
Created attachment 13390 [details]
test case

This is the test case from the RH bug:
http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=236832
Comment 2 Andrew Overholt 2007-04-18 21:27:28 UTC
In http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=236832#c2, Tom Tromey wrote:
> how does Mylar use this socket once it has created it?

Socket socket = getSslContext().getSocketFactory().createSocket();
socket.bind(new InetSocketAddress(clientHost, clientPort));
socket.connect(new InetSocketAddress(remoteHost, remotePort), params.getConnectionTimeout());

I'm not sure if we have a timeout somewhere.  I changed these calls to:

Socket socket = getSslContext().getSocketFactory().createSocket(remoteHost, remotePort, clientHost, clientPort);

It'd be cool if someone could tell me whether or not that's crack-tastic.  It seems to work with gij but it should work with the proprietary VMs as well.  I this it works, but I haven't tested extensively.  
Comment 3 Tom Tromey 2007-04-18 21:30:50 UTC
Andrew -- yeah, that change is perfectly fine.
I'm not expert enough with our SSL socket code to know whether or
not it would be easy to modify it to do this.
I looked at it briefly but the SLLSocketImpl constructors appear
to do some non-trivial work, and I didn't dive deeply enough to
see what needs to be changed here.
Comment 4 cvs-commit@developer.classpath.org 2007-04-19 21:45:01 UTC
Subject: Bug 31626

CVSROOT:	/cvsroot/classpath
Module name:	classpath
Changes by:	Tom Tromey <tromey>	07/04/19 20:44:44

Modified files:
	.              : ChangeLog 
	gnu/javax/net/ssl/provider: SSLSocketFactoryImpl.java 

Log message:
	2007-04-19  Casey Marshall  <csm@gnu.org>
	
		PR classpath/31626:
		* gnu/javax/net/ssl/provider/SSLSocketFactoryImpl.java
		(createSocket): New method.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpath&r1=1.9278&r2=1.9279
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/javax/net/ssl/provider/SSLSocketFactoryImpl.java?cvsroot=classpath&r1=1.3&r2=1.4



Comment 5 Tom Tromey 2007-04-19 21:50:59 UTC
Subject: Bug 31626

Author: tromey
Date: Thu Apr 19 21:50:40 2007
New Revision: 123977

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=123977
Log:
libjava
	* gnu/javax/net/ssl/provider/SSLSocketFactoryImpl.h: Rebuilt.
libjava/classpath
2007-04-19  Casey Marshall  <csm@gnu.org>
	PR classpath/31626:
	* gnu/javax/net/ssl/provider/SSLSocketFactoryImpl.java
	(createSocket): New method.

Modified:
    trunk/libjava/ChangeLog
    trunk/libjava/classpath/ChangeLog
    trunk/libjava/classpath/gnu/javax/net/ssl/provider/SSLSocketFactoryImpl.java
    trunk/libjava/classpath/lib/gnu/javax/net/ssl/provider/SSLSocketFactoryImpl.class
    trunk/libjava/gnu/java/awt/peer/gtk/ComponentGraphics.h
    trunk/libjava/gnu/javax/net/ssl/provider/SSLSocketFactoryImpl.h

Comment 6 Tom Tromey 2007-04-19 21:53:15 UTC
Subject: Bug 31626

Author: tromey
Date: Thu Apr 19 21:52:57 2007
New Revision: 123978

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=123978
Log:
2007-04-19  Casey Marshall  <csm@gnu.org>

	PR classpath/31626:
	* gnu/javax/net/ssl/provider/SSLSocketFactoryImpl.java
	(createSocket): New method.

Modified:
    branches/redhat/gcc-4_1-branch/libjava/classpath/ChangeLog
    branches/redhat/gcc-4_1-branch/libjava/classpath/gnu/javax/net/ssl/provider/SSLSocketFactoryImpl.java

Comment 7 Tom Tromey 2007-04-19 21:56:43 UTC
Fix checked in.
The target milestone here may or may not be bogus depending on
whether Mark pulls the patch to the release branch.
Comment 8 cvs-commit@developer.classpath.org 2007-04-20 09:03:54 UTC
Subject: Bug 31626

CVSROOT:	/cvsroot/classpath
Module name:	classpath
Branch:		classpath-0_95-branch
Changes by:	Mark Wielaard <mark>	07/04/20 08:03:38

Modified files:
	.              : ChangeLog 
	gnu/javax/net/ssl/provider: SSLSocketFactoryImpl.java 

Log message:
	2007-04-19  Casey Marshall  <csm@gnu.org>
	
	       PR classpath/31626:
	       * gnu/javax/net/ssl/provider/SSLSocketFactoryImpl.java
	       (createSocket): New method.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpath&only_with_tag=classpath-0_95-branch&r1=1.9222.2.19&r2=1.9222.2.20
http://cvs.savannah.gnu.org/viewcvs/classpath/gnu/javax/net/ssl/provider/SSLSocketFactoryImpl.java?cvsroot=classpath&only_with_tag=classpath-0_95-branch&r1=1.2.2.1&r2=1.2.2.2