Java - https webservice certificados

 
Vista:

https webservice certificados

Publicado por arf2774 (1 intervención) el 05/02/2016 15:45:50
Hola

estoy intentando realizar una llamada a una dirección https,

tengo este código:

SocketAddress addr = new InetSocketAddress("......", 80);
Proxy proxy = new Proxy(Proxy.Type.HTTP, addr);

URL url = new URL("https://...........");
HttpURLConnection connection = (HttpURLConnection) url.openConnection(proxy);

connection.setRequestProperty("CONTENT_LENGTH", "" + msg.length());
connection.setRequestProperty("Connection", "keep-alive");
connection.setRequestProperty("Content-Type", "text/xml;charset=UTF-8");
connection.setRequestProperty("Cache-Control", "no-cache");

este código lo pruebo con java 1.7 y funciona perfectamente pero tengo la necesidad de que funcione para java 1.6 y no se como hacerlo. Utilizo el servidos glassfish.

cuando utilizo java 1.6 el erro que me da es el siguiente:

Advertencia: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:882)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1188)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1215)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1199)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:434)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:166)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1031)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:230)
at com.inetpsa.dcr.syncService.services.ConnectorService.callWebServiceProxy(ConnectorService.java:523)
at com.inetpsa.dcr.syncService.services.ConnectorService.callWebService(ConnectorService.java:345)
at com.inetpsa.dcr.syncService.services.impl.CSBLocaleServiceImpl.sendConnectorWS(CSBLocaleServiceImpl.java:86)
at com.inetpsa.dcr.syncService.interconnect.impl.WebServiceInterfaceType.run(WebServiceInterfaceType.java:26)
at com.inetpsa.dcr.syncService.manager.impl.InterfaceSiManagerServiceImpl.execute(InterfaceSiManagerServiceImpl.java:185)
at com.inetpsa.dcr.syncService.services.impl.GestionInterfaceSiThreadService.callGestionInterfaceSiRunnable(GestionInterfaceSiThreadService.java:66)
at com.inetpsa.dcr.syncService.services.impl.GestionInterfaceSiThreadService$$FastClassByCGLIB$$d7baeb27.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.aop.interceptor.AsyncExecutionInterceptor$1.call(AsyncExecutionInterceptor.java:83)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.io.EOFException: SSL peer shut down incorrectly
at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:462)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:863)
... 21 more

alguien me puede ayudar?

Gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil
Val: 87
Ha aumentado su posición en 2 puestos en Java (en relación al último mes)
Gráfica de Java

https webservice certificados

Publicado por Tomas (76 intervenciones) el 07/02/2016 20:06:33
No sé mucho de esto pero estoy seguro que te dice que se encontro con el final de fichero < Caused by: java.io.EOFException (End of file Exception) y no cerraste la conexión ssl adecuadamente.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar