title: Java 11 SSLHandshakeException with TLS 1.3: How do I revert to TLS 1.2?
body: <p>My application is a form of "web scraper" which loads the HTML from a desired input page using <a href="https://jsoup.org/" rel="noreferrer">the Java Jsoup library</a>. I recently upgraded my application platform from Java 8 to Java 11. With this upgrade, I have received several reports from my clients saying that they receive SSLHandshakeExceptions while trying to load the HTML content of certain webpages. The webpages these occur on vary from device to device, and on some devices, my clients are not able to load any webpages at all (neither http:// nor https:// webpages).</p>
  
  <p>I've tried resolving this in several ways but to no avail:</p>
  
  <ol>
  <li>Replacing the Java 11 runtime's CACERT file with the Java 8 runtime's CACERT file</li>
  <li>Creating a custom SSL certificate acceptor which accepts all SSL certificates regardless of validity (I know this is bad for production code but this was just for test purposes) - see <a href="https://stackoverflow.com/questions/2642777/trusting-all-certificates-using-httpclient-over-https">Trusting all certificates using HttpClient over HTTPS</a></li>
  </ol>
  
  <p>At this point, I'm not really sure what options to take, since I have a limited knowledge of SSL, TLS, and HTTPS. These errors never occurred in Java 8, and everything used to work fine before the upgrade to Java 11. </p>
  
  <p>From my understanding, the only thing Java 11 changed about SSL was upgrading to TLS 1.3, while previous version of Java relied on using TLS 1.2. </p>
  
  <p><strong>Hence, I would like to force Java 11 to use TLS 1.2 rather than TLS 1.3, as I believe this to be the cause of the SSLHandshakeExceptions. How should I go about doing this?</strong></p>