tls-versions-jdk.asciidoc 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. [role="xpack"]
  2. [[jdk-tls-versions]]
  3. === Supported SSL/TLS versions by JDK version
  4. {es} relies on your JDK's implementation of SSL and TLS.
  5. Different JDK versions support different versions of SSL, and this may affect how {es} operates.
  6. [NOTE]
  7. ====
  8. This support applies when running on the default JSSE provider in the JDK.
  9. JVMs that are configured to use a <<fips-140-compliance, FIPS 140-2>> security
  10. provider might have a custom TLS implementation, which might support TLS
  11. protocol versions that differ from this list.
  12. Check your security provider's release notes for information on TLS support.
  13. ====
  14. `SSLv3`::
  15. SSL v3 is supported on all {es} <<jvm-version,compatible JDKs>> but is disabled by default.
  16. See <<jdk-enable-tls-protocol>>.
  17. `TLSv1`::
  18. TLS v1.0 is supported on all {es} <<jvm-version,compatible JDKs>>.
  19. Some newer JDKs, including the JDK bundled with {es}, disable TLS v1.0 by default.
  20. See <<jdk-enable-tls-protocol>>.
  21. `TLSv1.1`::
  22. TLS v1.1 is supported on all {es} <<jvm-version,compatible JDKs>>.
  23. Some newer JDKs, including the JDK bundled with {es}, disable TLS v1.1 by default.
  24. See <<jdk-enable-tls-protocol>>.
  25. `TLSv1.2`::
  26. TLS v1.2 is supported on all {es} <<jvm-version,compatible JDKs>>.
  27. It is enabled by default on all JDKs that are supported by {es}, including the bundled JDK.
  28. `TLSv1.3`::
  29. TLS v1.3 is supported on JDK11 and later, and JDK8 builds newer than 8u261
  30. (including the most recent release of each JDK8 distribution that {es} supports).
  31. TLS v1.3 is supported and enabled by default on the JDK that is bundled with {es}.
  32. +
  33. NOTE: Although {es} supports running on older JDK8 builds without TLS v1.3,
  34. we recommend upgrading to a JDK version that includes TLS v1.3 for better
  35. support and updates.
  36. [[jdk-enable-tls-protocol]]
  37. ==== Enabling additional SSL/TLS versions on your JDK
  38. The set of supported SSL/TLS versions for a JDK is controlled by a java security
  39. properties file that is installed as part of your JDK.
  40. This configuration file lists the SSL/TLS algorithms that are disabled in that JDK.
  41. Complete these steps to remove a TLS version from that list and use it in your JDK.
  42. 1. Locate the configuration file for your JDK.
  43. 2. Copy the `jdk.tls.disabledAlgorithms` setting from that file, and add it to a custom
  44. configuration file within the {es} configuration directory.
  45. 3. In the custom configuration file, remove the value for the TLS version you want
  46. to use from `jdk.tls.disabledAlgorithms`.
  47. 4. Configure {es} to pass a custom system property to the JDK so that your custom
  48. configuration file is used.
  49. ===== Locate the configuration file for your JDK
  50. For the {es} **bundled JDK**, the configuration file is in a sub directory of
  51. the {es} home directory (`$ES_HOME`):
  52. * Linux: `$ES_HOME/jdk/conf/security/java.security`
  53. * Windows: `$ES_HOME/jdk/conf/security/java.security`
  54. * macOS:`$ES_HOME/jdk.app/Contents/Home/conf/security/java.security`
  55. For **JDK8**, the configuration file is within the `jre/lib/security` directory
  56. of the Java installation.
  57. If `$JAVA_HOME` points to the home directory of the JDK that you use to run {es},
  58. then the configuration file will be in:
  59. * `$JAVA_HOME/jre/lib/security/java.security`
  60. For **JDK11 or later**, the configuration file is within the `conf/security`
  61. directory of the Java installation.
  62. If `$JAVA_HOME` points to the home directory of the JDK that you use to run
  63. {es}, then the configuration file will be in:
  64. * `$JAVA_HOME/conf/security/java.security`
  65. ===== Copy the disabledAlgorithms setting
  66. Within the JDK configuration file is a line that starts with
  67. `jdk.tls.disabledAlgorithms=`.
  68. This setting controls which protocols and algorithms are _disabled_ in your JDK.
  69. The value of that setting will typically span multiple lines.
  70. For example, in OpenJDK 16 the setting is:
  71. [source,text]
  72. --------------------------------------------------
  73. jdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1, RC4, DES, MD5withRSA, \
  74. DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL
  75. --------------------------------------------------
  76. Create a new file in your in your {es} configuration directory named `es.java.security`.
  77. Copy the `jdk.tls.disabledAlgorithms` setting from the JDK's default configuration file into `es.java.security`.
  78. You do not need to copy any other settings.
  79. ===== Enable required TLS versions
  80. Edit the `es.java.security` file in your {es} configuration directory, and
  81. modify the `jdk.tls.disabledAlgorithms` setting so that any SSL or TLS versions
  82. that you wish to use are no longer listed.
  83. For example, to enable TLSv1.1 on OpenJDK 16 (which uses the
  84. `jdk.tls.disabledAlgorithms` settings shown previously), the
  85. `es.java.security` file would contain the previously disabled TLS algorithms
  86. _except_ `TLSv1.1`:
  87. [source,text]
  88. --------------------------------------------------
  89. jdk.tls.disabledAlgorithms=SSLv3, TLSv1, RC4, DES, MD5withRSA, \
  90. DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL
  91. --------------------------------------------------
  92. ===== Enable your custom security configuration
  93. To enable your custom security policy, add a file in the <<set-jvm-options, `jvm.options.d`>>
  94. directory within your {es} configuration directory.
  95. To enable your custom security policy, create a file named
  96. `java.security.options` within the <<set-jvm-options, jvm.options.d>>
  97. directory of your {es} configuration directory, with this content:
  98. [source,text]
  99. ----
  100. -Djava.security.properties=/path/to/your/es.java.security
  101. ----
  102. ==== Enabling TLS versions in {es}
  103. SSL/TLS versions can be enabled and disabled within {es} via the
  104. <<ssl-tls-settings,`ssl.supported_protocols` settings>>.
  105. {es} will only support the TLS versions that are enabled by the
  106. <<jdk-tls-versions,underlying JDK>>. If you configure
  107. `ssl.supported_procotols` to include a TLS version that is not enabled in your
  108. JDK, then it will be silently ignored.
  109. Similarly, a TLS version that is enabled in your JDK, will not be used unless
  110. it is configured as one of the `ssl.supported_protocols` in {es}.