---
title: "Https - TLSv1.2"
author: "marlgl"
date: "2016-05-25T15:39:49Z"
tags: []
categories: ["Web前端"]
slug: "https-tlsv1-2"
draft: false
lastmod: "2016-05-25T16:00:38Z"
id: 2300857
url: "https://marlgl.iteye.com/blog/2300857"
---

大于8k左右的数据请求（PUT/POST）无法与server通信 \[b]Chrome: Error (net::ERR\_SSL\_PROTOCOL\_ERROR): SSL protocol error.\[/b] public class ShortBufferException extends GeneralSecurityException This exception is thrown when an output buffer provided by the user is too short to hold the operation result. Tomcat 8.0 disable TLS1.2 \[code="java"]\[/code] \[code="java"]\[/code] HTTPS connector parameter sslProtocol defines which SSL/TLS protocols are enabled by default, e.g. for Oracle JDK 7: 1) setProtocol="TLS" will enable SSLv3 and TLSv1 2) setProtocol="TLSv1.2" will enable SSLv3, TLSv1, TLSv1.1 and TLS v1.2 3) setProtocol="TLSv1.1" will enable SSLv3, TLSv1, and TLSv1.1 4) setProtocol="TLSv1" will enable SSLv3 and TLSv1 5) setProtocol="SSL" will enable SSLv3 and TLSv1 6) setProtocol="SSLv3" will enable SSLv3 and TLSv1 7) setProtocol="SSLv2" won't work So, in order to restrict available protocols only to TLSv1.1, you need to add parameter sslEnabledProtocols="TLSv1.1" to your connector. Note that even if some protocol is not enabled by default, you may enable it by specifying sslEnabledProtocols parameter. E.g. sslProtocol="SSL" sslEnabledProtocols="TLSv1.1" is somewhat confusing, but perfectly legal. 参考： \[url]https://bugs.openjdk.java.net/browse/JDK-8036970\[/url] \[url]https://www.ssl.com/how-to/turn-off-ssl-3-0-and-tls-1-0-in-your-browser/\[/url] \[url]http://docs.oracle.com/javase/8/docs/api/javax/crypto/ShortBufferException.html\[/url] \[url]http://docs.oracle.com/javase/8/docs/technotes/guides/security/StandardNames.html#SSLContext\[/url] \[url]http://bugs.java.com/bugdatabase/view\_bug.do?bug\_id=7031830\[/url] \[url]http://mail-archives.apache.org/mod\_mbox/tomcat-users/201303.mbox/%3C13A085B2E018374C813676301AED0EE412D87457C3@BLR0EXC00.us.sonicwall.com%3E\[/url] \[url]https://technet.microsoft.com/en-us/library/cc783349(v=ws.10).aspx\[/url]