Skip to content

Instantly share code, notes, and snippets.

@pollux-
Last active March 7, 2019 01:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pollux-/85feb52264eb9d380ddbd3545ce2e050 to your computer and use it in GitHub Desktop.
Save pollux-/85feb52264eb9d380ddbd3545ce2e050 to your computer and use it in GitHub Desktop.
Force the connection to use only TLS v.1.2 avoiding the fallback to older version to avoid vulnerabilities
/**
* Force the connection to use only TLS v.1.2 avoiding the fallback to older version to avoid vulnerabilities
*
*/
final ConnectionSpec.Builder connectionSpec =
new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS);
connectionSpec.tlsVersions(TlsVersion.TLS_1_2).build();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment