SSL Socket Programming.
Hi guy's , im currently on socket programming here.
Im trying to read the content of an https page with an applet. So im writing the socket , and everything work fine the first time im running the applet, but when im trying to reload the page , after few try ( never the same number of try ) ive got an SSLException :
FATAL ERROR BAD_RECORD_MAC
But when im trying to do the same code localy on my machine , not in an applet , ive got no problems reading the page.
Did someone know if java 6.0 have problems with applet and socket matches ?
Here my code :
try
{
String urlString ="https://www.monsite.com/index.html";
URL url =new URL(urlString);
SSLSocketFactory factory = (SSLSocketFactory)SSLSocketFactory.getDefault();
SSLSocket socket = (SSLSocket)factory.createSocket(url.getHost(), 443);
PrintWriter out =new PrintWriter(new OutputStreamWriter( socket.getOutputStream()));
out.println("GET /index.html HTTP/1.1\r");
out.println("Host:monsite.com \r\n\r");
out.println();
out.flush();
BufferedReader in =new BufferedReader(
new InputStreamReader(
socket.getInputStream()));
String line;
while ((line = in.readLine()) !=null){
System.out.println(line);
}
out.close();
in.close();
}
catch(Exception e)
{
System.out.println("in the exception :"+e.getMessage());
}
Please , help me , ive got no idea what to do with that.
sorry for my english , im from quebec so its why ive got probably a lot of mistake ;)

