# Issue with TLSv1 support in java-1.8.0-openjdk package on Rocky Linux 8

**URL:** <https://forums.rockylinux.org/t/issue-with-tlsv1-support-in-java-1-8-0-openjdk-package-on-rocky-linux-8/14935>\
**Category:** Rocky Linux Help & Support\
**Created:** [July 5, 2024, 7:53am UTC](https://forums.rockylinux.org/t/issue-with-tlsv1-support-in-java-1-8-0-openjdk-package-on-rocky-linux-8/14935 "2024-07-05T07:53:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![seondlinedragonfly](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@seondlinedragonfly](https://forums.rockylinux.org/u/seondlinedragonfly)\
**Post date:** [July 5, 2024, 7:53am UTC](https://forums.rockylinux.org/t/issue-with-tlsv1-support-in-java-1-8-0-openjdk-package-on-rocky-linux-8/14935/1 "2024-07-05T07:53:41Z")

</div>

Hello Rocky Linux community,

I’m encountering an issue with TLSv1 support in the java-1.8.0-openjdk package on Rocky Linux 8.10. My application needs to communicate with a server that only supports TLSv1, and I’m unable to enable TLSv1 in the OpenJDK package provided by Rocky Linux.

Environment details:

- OS Image: dokken/rockylinux-8:latest (Rocky Linux 8.10)
- Java package: java-1.8.0-openjdk.x86\_64 / 1:1.8.0.412.b08-2.el8 / @appstream

Here’s what I’ve observed:

1. I modified the java.security file to remove TLSv1 and TLSv1.1 from the jdk.tls.disabledAlgorithms list:

2. I’m using the following test code to check supported and enabled protocols:

> import javax.net.ssl.SSLSocket;  
> import javax.net.ssl.SSLContext;  
> import javax.net.ssl.SSLSocketFactory;

public class ProtocolTest {  
public static void main(String args) throws Exception {  
SSLContext context = SSLContext.getInstance(“TLS”);  
context.init(null,null,null);  
SSLSocketFactory factory = (SSLSocketFactory)context.getSocketFactory();  
SSLSocket socket = (SSLSocket)factory.createSocket();  
String protocols = socket.getSupportedProtocols();  
System.out.println(“Supported Protocols: " + protocols.length);  
for(int i = 0; i \< protocols.length; i++) {  
System.out.println(” " + protocols[i]);  
}  
protocols = socket.getEnabledProtocols();  
System.out.println(“\nEnabled Protocols: " + protocols.length);  
for(int i = 0; i \< protocols.length; i++) {  
System.out.println(” " + protocols[i]);  
}  
}  
}

1. When I run this test with the java-1.8.0-openjdk package:

2. However, when I use the temurin-8-jdk package (version 8.0.412.0.0.8-1) with the same modified java.security file, TLSv1 and TLSv1.1 are enabled as expected.

I’ve tried various approaches, including:

- Using system properties like -Dhttps.protocols and -Djdk.tls.client.protocols
- Checking for additional security configurations
- Running with debug options

None of these attempts have been successful in enabling TLSv1 with the java-1.8.0-openjdk package.

My questions are:

1. Is there any known additional hardening or configuration in the Rocky Linux OpenJDK package that prevents enabling TLSv1, even when removed from the disabled algorithms list?
2. If so, is there a way to override this and enable TLSv1 support?
3. If not, could this be a bug or an unintended behavior in the package?

Any insights or guidance on this issue would be greatly appreciated. Thank you for your time and assistance.

---

<div class="post-metadata">

**Author:** ![anthyve](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@anthyve](https://forums.rockylinux.org/u/anthyve)\
**Post date:** [July 5, 2024, 12:09pm UTC](https://forums.rockylinux.org/t/issue-with-tlsv1-support-in-java-1-8-0-openjdk-package-on-rocky-linux-8/14935/2 "2024-07-05T12:09:36Z")

</div>

Java from Rocky Linux repository honors crypto-policy, a centralized configuration for (most) cryptographic libraries on the host. Crypto-policy settings take precedence over jdk.tls.disabledAlgorithms you manually set, and default crypto policy prohibits TLS v1, but legacy allows it.

The quickest way to get there is to set it to legacy:

```shell
update-crypto-policies --set LEGACY

```

Be aware that:

- this enables TLSv1 but also weakens crypto (minimal key sizes, etc)
- is applicable to all crypto libraries covered by crypto-policies, not just in Java client.

If you wanted to limit to TLS v1 and to java only, you could make write a crypto-policy module that only modifies the java configuration.

---

<div class="post-metadata">

**Author:** ![seondlinedragonfly](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@seondlinedragonfly](https://forums.rockylinux.org/u/seondlinedragonfly)\
**Post date:** [July 8, 2024, 12:27am UTC](https://forums.rockylinux.org/t/issue-with-tlsv1-support-in-java-1-8-0-openjdk-package-on-rocky-linux-8/14935/3 "2024-07-08T00:27:50Z")

</div>

Thanks to you, the problem is solved. Thank you!  
Using the above command, it was possible to allow TLSv1 communication without modifying the java.security file.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/1X/91b7219eec10e30013422e4df76c1d898711a5d5.svg) [@system](https://forums.rockylinux.org/u/system)\
**Post date:** [September 6, 2024, 12:28am UTC](https://forums.rockylinux.org/t/issue-with-tlsv1-support-in-java-1-8-0-openjdk-package-on-rocky-linux-8/14935/4 "2024-09-06T00:28:04Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
