如何在 Android 上创建压缩 SSL/TLS 连接
我想要与服务器建立 https 连接,但为了节省带宽,我希望对其进行压缩。 我听说一些SSL实现支持压缩(我不是指HTTP负载本身的zlib编码),它可以在android中激活吗? 我在 javax.net.ssl.HttpsURLConnection 中找不到任何对它的引用 也不在 javax.net.ssl.SSLServerSocketFactory 中
i want to have an https connection to the server, but in order to conserve bandwidth i want it to be compressed.
I heard that some SSL implementations support compression (i dont mean the zlib encoding of the HTTP payload itself), can it be activated in android?
i couldnt find any reference to it neither in javax.net.ssl.HttpsURLConnection
nor in javax.net.ssl.SSLServerSocketFactory
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SSL 和 TLS 的定义是为了包含压缩功能,但 Java JSSE(即
javax.net.ssl.*
)不支持它,至少在 Oracle 的实现中是这样。使用 zip 编码。 zip 编码发生在纯文本内容上,然后对其应用 SSL。编辑 默认情况下,除 OpenSSL 之外的任何其他版本均不支持。 “保守实现不会在 TLS 级别启用压缩”
SSL and TLS were defined so as to include a compression feature, but it isn't supported in Java JSSE, i.e.
javax.net.ssl.*
, at least in Oracle's implementation. Use zip-encoding. The zip-encoding happens to the plaintext content, then SSL is applied over that.EDIT Not supported by default in anything else except OpenSSL either as of date. ' conservative implementations do not enable compression at the TLS level'