4 Replies Latest reply on Aug 24, 2007 4:55 PM by 843811

    Getting javax.net.ssl.SSLException: Received fatal alert: bad_record_mac

    843811
      I am using a java client to talk with a servlet deployed on weblogic6.1 server using jsse.
      But i am getting the following error (as pasted below) . Can any one pls help me out?

      Exception in thread "main" javax.net.ssl.SSLException: Received fatal alert: bad_record_mac
      at com.sun.net.ssl.internal.ssl.SSLSocketImpl.b([DashoPro-V1.2-120198])
      at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a([DashoPro-V1.2-120198])
      at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a([DashoPro-V1.2-120198])
      at com.sun.net.ssl.internal.ssl.AppOutputStream.write([DashoPro-V1.2-120198])
      at java.io.OutputStream.write(Unknown Source)
      at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake([DashoPro-V1.2-120198])
      at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.doConnect([DashoPro-V1.2-120198])

      at com.sun.net.ssl.internal.www.protocol.https.NetworkClient.openServer([DashoPro-V1.2-12019
      8])
      at com.sun.net.ssl.internal.www.protocol.https.HttpClient.l([DashoPro-V1.2-120198])
      at com.sun.net.ssl.internal.www.protocol.https.HttpClient.<init>([DashoPro-V1.2-120198])
      at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.<init>([DashoPro-V1.2-120198])
      at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.a([DashoPro-V1.2-120198])
      at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.a([DashoPro-V1.2-120198])
      at com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection.connect([DashoPro-V1.2-120
      198])
      at com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection.getInputStream([DashoPro-V
      1.2-120198])
      at Cert.main(Cert.java:54)
        • 1. Re: Getting javax.net.ssl.SSLException: Received fatal alert: bad_record_ma
          843811
          Have a look at bug 4513263, http://developer.java.sun.com/developer/bugParade/bugs/4513263.html

          The key for me in fixing the bad_record_mac problem was a one-liner fix to disable TLS by calling:
              socket.setEnabledProtocols(new String[] {"SSLv3"});
          Hope this fixes it for you...

          -Steve
          • 2. Re: Getting javax.net.ssl.SSLException: Received fatal alert: bad_record_ma
            843811
            I am getting this error using SSLv3. Have attempted setting the protocol to
            TLSv1, and then SSLv2Hello, then added SSLv3. None of this helped.
            If I leave out SSLv3, then the javax.debug.net=ssl messages complain
            that SSLv3 is not enabled.

            How does Mozilla FireFox get this?

            sjohnson@mercury.com
            • 3. Re: Getting javax.net.ssl.SSLException: Received fatal alert: bad_record_ma
              843811
              Hi

              I get the same error bad_record_mac and I have no idea on howto fix it.

              I try the proposed solution without result
              (socket.setEnabledProtocols(new String[] {"SSLv3"});)
              And I triedto follow the bug link : http://developer.java.sun.com/developer/bugParade/bugs/4513263.html
              But it seems to be broken

              I got stuck from afew days and I have no ideas.

              Thank's for any help

              Andre
              Detail of error bellow

              Exception in thread "main" javax.net.ssl.SSLException: Received fatal alert: bad_record_mac
              at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(DashoA6275)
              at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.b(DashoA6275)
              at com.sun.net.ssl.internal.ssl.SSLSocketImpl.b(DashoA6275)
              at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
              at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA6275)
              at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
              at com.sun.net.ssl.internal.ssl.AppOutputStream.write(DashoA6275)
              at sun.nio.cs.StreamEncoder$CharsetSE.writeBytes(StreamEncoder.java:336)
              at sun.nio.cs.StreamEncoder$CharsetSE.implFlushBuffer(StreamEncoder.java:404)
              at sun.nio.cs.StreamEncoder$CharsetSE.implFlush(StreamEncoder.java:408)
              at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:152)
              at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:213)
              at Test.main(Test.java:29)
              • 4. Re: Getting javax.net.ssl.SSLException: Received fatal alert: bad_record_ma
                843811
                blogic.socket.Muxer'> <<WLS Kernel>> <> <BEA-000430> <isMessageComplete
                javax.net.ssl.SSLProtocolException: FATAL Alert:BAD_RECORD_MAC - A record was received with an incorrect MAC.
                javax.net.ssl.SSLProtocolException: FATAL Alert:BAD_RECORD_MAC - A record was received with an incorrect MAC.
                at com.certicom.tls.interfaceimpl.TLSConnectionImpl.fireException(Unknown Source)
                at com.certicom.tls.interfaceimpl.TLSConnectionImpl.fireAlertSent(Unknown Source)
                at com.certicom.tls.record.MessageInterpreter.fireAlert(Unknown Source)
                at com.certicom.tls.record.MessageInterpreter.decryptMessage(Unknown Source)
                at com.certicom.tls.record.ReadHandler.processRecord(Unknown Source)
                at com.certicom.tls.record.ReadHandler.readRecord(Unknown Source)
                at com.certicom.tls.record.ReadHandler.read(Unknown Source)
                at com.certicom.io.InputSSLIOStreamWrapper.read(Unknown Source)
                at weblogic.socket.SSLFilter.isMessageComplete(SSLFilter.java:225)
                at weblogic.socket.SocketMuxer.readReadySocketOnce(SocketMuxer.java:700)
                at weblogic.socket.SocketMuxer.readReadySocket(SocketMuxer.java:651)
                at weblogic.socket.PosixSocketMuxer.processSockets(PosixSocketMuxer.java:123)
                at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:32)
                at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
                at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)