• Post Reply Bookmark Topic Watch Topic
  • New Topic

IOException while trying to connect using ssl

Krishna Chaitanya
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got the following exception while trying to connect to a remote server using ssl, Could anybody tell me why and when do these kind of exceptions arise.

I'm establishing a connection in the following manner

String url ="ssl://";
System.out.println("before connecting to ssl");
StreamConnection socket = (StreamConnection)Connector.open
System.out.println("after connecting to ssl");

I got the following exception message

java.io.IOException: Bad record type (97) or version (97.97)
at com.sun.midp.ssl.Record.rdRec(+284)
at com.sun.midp.ssl.Record.rdRec(+5)
at com.sun.midp.ssl.Handshake.getNextMsg(+17)
at com.sun.midp.ssl.Handshake.rcvSrvrHello(+5)
at com.sun.midp.ssl.Handshake.doHandShake(+29)
at com.sun.midp.ssl.SSLStreamConnection.<init>(+157)
at com.sun.midp.io.j2me.ssl.Protocol.openPrim(+249)
at javax.microedition.io.Connector.openPrim(+299)
at javax.microedition.io.Connector.open(+15)
at UtilityServices.connectSSL(+28)
at UtilityServices.run(+12)
Theodore Casser
Ranch Hand
Posts: 1902
Hibernate Netbeans IDE PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I originally started leaving a post about the fact that I get a different exception when I run your code, until I looked at the exception again. It looks like it might be something having to do with the actual connection... Have you tested the connection through other means to make sure it's returning what you think it should be?
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!