Skip navigation
3306 Views 1 Reply Latest reply: Sep 7, 2011 12:34 AM by Jim Lu RSS
jiale.chan Bronze 1 posts since
Sep 20, 2010
Currently Being Moderated

Sep 20, 2010 11:26 PM

Got the "javax.net.ssl.SSLException: Received fatal alert: internal_error"

Hi, i establish the openfire(Openfire 3.6.4) in the server(suse linux) and use below code with smack(3.1) api to try to connect the server:

 

     ConnectionConfiguration config = new ConnectionConfiguration("***.***.***.***");

     XMPPConnection connection = new XMPPConnection(config);

     connection.connect();
     connection.login("user", "password");

 

but it didn't work, i got some exception as below:

 

javax.net.ssl.SSLException: Received fatal alert: internal_error
    at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:190)
    at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:136)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1682)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:932)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImp l.java:1112)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:11 39)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:11 23)
    at org.jivesoftware.smack.XMPPConnection.proceedTLSReceived(XMPPConnection.java:12 58)
    at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:313)
    at org.jivesoftware.smack.PacketReader.access$0(PacketReader.java:266)
    at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:76)
java.lang.IllegalStateException: Not connected to server.
    at org.jivesoftware.smack.XMPPConnection.sendPacket(XMPPConnection.java:729)
    at org.jivesoftware.smack.NonSASLAuthentication.authenticate(NonSASLAuthentication .java:70)
    at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java: 336)
    at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:395)
    at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:349)
    at app.MainRun6.main(MainRun6.java:26)
Exception in thread "main" java.lang.IllegalStateException: Not connected to server.
    at org.jivesoftware.smack.XMPPConnection.sendPacket(XMPPConnection.java:729)
    at org.jivesoftware.smack.NonSASLAuthentication.authenticate(NonSASLAuthentication .java:70)
    at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java: 346)
    at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:395)
    at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:349)
    at app.MainRun6.main(MainRun6.java:26)

 

But i change code like this:

 

     ...

     connection.connect();

     Thread.sleep(31000);
      connection.login("user", "password");

     ...

 

the connect will be success.

 

It seem delay some time will be ok?

 

 

Thank for your help!

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points