Menu

Using JML with SOCKS proxy

2010-06-17
2013-04-29
  • Praveen Mittal

    Praveen Mittal - 2010-06-17

    Hi,

    We are using SOCKS version 4 proxy in our environment to connect to MSN. I tried using jml api to connect to MSN but it is not working. Whereas in the environment which is without proxy, the connection is working fine. Could you please help me in resolving this issue?

    Thanks in advance.

     
  • Damian Minkov

    Damian Minkov - 2010-06-17

    Hi,

    have you tried using java network properties like socksProxyHost and socksProxyPort?

     
  • Praveen Mittal

    Praveen Mittal - 2010-06-17

    Thanks a lot for the quick response.

    I have not yet tried that. I was going through the API and couldn't find anything to set the proxy. Are you referring to the properties mentioned below: -

    System.getProperties().put( "socksProxyPort", "1080");
    System.getProperties().put( "socksProxyHost" ,"proxy.host.address");

    If yes, then where should I set these properties. Should I set these before calling the login() API?

     
  • Damian Minkov

    Damian Minkov - 2010-06-17

    Yes before connecting to msn. These properties are considered from java when creating Sockets.

     
  • Praveen Mittal

    Praveen Mittal - 2010-06-17

    thanks a lot. I am testing this and will let you know whether it works or not.

    Thanks again :)

     
  • cmarina

    cmarina - 2010-06-17

    Hi … I was having the same problem and while looking for a clue how to get over that I've arrived here on this thread … tried setting the properties but no luck … any other ideas ?

    thanks a lot

     
  • Praveen Mittal

    Praveen Mittal - 2010-06-22

    After setting these properties, my application is using the proxy and able to connect as well. But when I am trying to connect to a proxy which is SSL enabled, I am getting the SSLHandShakeException. Please let me know if anybody has faced this kind of issue.

    thanks is advance.

     
  • Damian Minkov

    Damian Minkov - 2010-06-22

    You can try installing your own TrustManager which checks or trusts all Certificates.

     
  • Praveen Mittal

    Praveen Mittal - 2010-06-22

    I gave the following options in java command
    -Djavax.net.ssl.trustStore=.keystore -Djavax.net.ssl.trustStorePassword=changeit
    after adding this i got the following error: -

    - Login error
    javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLHands
    hakeException: Remote host closed connection during handshake
          at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkEOF(Unknown Source)
          at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkWrite(Unknown Source)

          at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown Source)
          at org.apache.http.impl.io.AbstractSessionOutputBuffer.flushBuffer(Abstr
    actSessionOutputBuffer.java:106)
          at org.apache.http.impl.io.AbstractSessionOutputBuffer.flush(AbstractSes
    sionOutputBuffer.java:113)
          at org.apache.http.impl.AbstractHttpClientConnection.doFlush(AbstractHtt
    pClientConnection.java:260)
          at org.apache.http.impl.SocketHttpClientConnection.close(SocketHttpClien
    tConnection.java:248)
          at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecu
    tor.java:130)
          at net.sf.jml.protocol.soap.SSO.getTicket(SSO.java:241)
          at net.sf.jml.protocol.soap.SSO.getTicket(SSO.java:82)
          at net.sf.jml.protocol.incoming.IncomingUSR$1.run(IncomingUSR.java:287)
    Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection du
    ring handshake
          at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)

          at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Un
    known Source)
          at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(Unknown Source
    )
          at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown Source)
          at org.apache.http.impl.io.AbstractSessionOutputBuffer.flushBuffer(Abstr
    actSessionOutputBuffer.java:106)
          at org.apache.http.impl.io.AbstractSessionOutputBuffer.write(AbstractSes
    sionOutputBuffer.java:126)
          at org.apache.http.impl.io.ContentLengthOutputStream.write(ContentLength
    OutputStream.java:121)
          at org.apache.http.impl.io.ContentLengthOutputStream.write(ContentLength
    OutputStream.java:127)
          at net.sf.jml.protocol.soap.XmlEntity.writeTo(XmlEntity.java:55)
          at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializ
    er.java:127)
          at org.apache.http.impl.AbstractHttpClientConnection.sendRequestEntity(A
    bstractHttpClientConnection.java:253)
          at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpReques
    tExecutor.java:249)
          at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecu
    tor.java:124)
          … 3 more
    Caused by: java.io.EOFException: SSL peer shut down incorrectly
          at com.sun.net.ssl.internal.ssl.InputRecord.read(Unknown Source)
          … 16 more

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.