【发布时间】:2014-11-08 15:38:09
【问题描述】:
我有一个 vps,我想在上面安装一个 java 服务器程序。 它包含 ssl,但我相信它不用于 java。至少它看起来并没有真正加密。 奇怪的是,从 ubuntu 服务器发送的 2 个字节被添加了,我没有指定,并且一些字节发生了变化。我知道需要知道为什么它在 Windows 上不这样做,而在我的 ubuntu vps 上这样做...... 如果不一样怎么解决。
我使用 printWriter 然后刷新到客户端。 和“ISO8859-1”来加密数据包,这些不是字符串或数字,只是我发送的普通字节。
protected Socket socket;
protected BufferedReader socketIn;
protected PrintWriter socketOut;
protected LoginServer server;
public static final byte[] LOGIN_SUCCESSBYTE = {(byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00};
this.socketOut.write(new String(LoginServer.LOGINHEADER, "ISO8859-1"));
this.socketOut.flush();
this.socketOut.write(new String(LoginServer.LOGIN_SUCCESSBYTE,"ISO8859-1"));
this.socketOut.flush();
windows发送的数据包
00000000 EC 2C 4A 00 01 00 02 00 00 00 FF 00 00 00 00 00 .,J........
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ..........
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ..........
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ......
ubuntu发送的数据包
00000000 C3 AC 2C 4A 00 01 00 02 00 00 00 C3 BF 00 00 00 ..,J..........
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ..........
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ..........
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
【问题讨论】:
-
请给我们看代码。
-
请包含表现出这种行为的代码。
标签: java ubuntu openssl vps packets