Fixed the bug of java.net.ProtocolException.