2

I have written below code to find out if remote socket is SSL/TLS. I am sending below message with content type BEEP+XML.

in the response I got response byte "128 3 0 0 1 -1 -1 ". Here, TLS/SSL message type is 128 but I can't find out what message type 128 stands for.

I found below link that lists out possible message type IDs but cannot find 128 in it. http://blogs.msdn.com/b/kaushal/archive/2012/10/06/ssl-tls-alert-protocol-amp-the-alert-codes.aspx

can anyone share their knowledge on this matter.

I am trying to connect to Webseal Reverse proxy through this code.

        byte[] TEST_MESSAGE = null;
        StringBuffer buffer = new StringBuffer();
        buffer.append("RPY 0 0 . 0 110\r\n");
        buffer.append("Content-Type: application/beep+xml\r\n");
        buffer.append("\r\n");
        buffer.append("<greeting>");
        buffer.append("   <profile uri='http://iana.org/beep/TLS' />\r\n");
        buffer.append("</greeting>\r\n");
        buffer.append("END");
        byte[] bytes = null;

        try {
            bytes = buffer.toString().getBytes("UTF-8");
        } catch (UnsupportedEncodingException ex) {
            // impossible; UTF-8 always supported
        }

        TEST_MESSAGE = bytes;

        Socket socket = null;
        try {
            // connect to the server
            socket = new Socket("localhost", 443);
        } catch (ConnectException e) {
            // Any connect exception here is most likely because the port is
            // not open at all...

        }

        try {
            // send a message to the server
            OutputStream output = socket.getOutputStream();
            output.write(TEST_MESSAGE);

            // Read the server's response. Since we sent a clear message,
            // an SSL server should return an error message in the format
            // described by the TLS protocol specification.

            InputStream input = socket.getInputStream();
Abhijeet Kale
  • 1,656
  • 1
  • 16
  • 34

0 Answers0