Тип сообщения SSL/TLS: 128
Я написал код ниже, чтобы узнать, является ли удаленный сокет SSL/TLS. Я отправляю ниже сообщение с типом контента BEEP + XML.
в ответ я получил ответный байт "128 3 0 0 1 -1 -1". Здесь тип сообщения TLS/SSL - 128, но я не могу узнать, что означает тип сообщения 128.
Ниже я нашел ссылку, в которой перечислены возможные идентификаторы типов сообщений, но не могу найти в ней 128. http://blogs.msdn.com/b/kaushal/archive/2012/10/06/ssl-tls-alert-protocol-amp-the-alert-codes.aspx
Кто-нибудь может поделиться своими знаниями по этому вопросу.
Я пытаюсь подключиться к обратному прокси Webseal через этот код.
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();