From bb184794341255cf02f9b7156c5ad828b172fdab Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Mon, 10 Aug 2020 14:03:23 +0200 Subject: [PATCH] Fix compilation error on JDK 15 (#10462) Motivation: AlgorithmId.sha256WithRSAEncryption_oid was removed in JDK15 and later so we should not depend on it as otherwise we will see compilation errors Modifications: Replace AlgorithmId.sha256WithRSAEncryption_oid usage with specify the OID directly Result: Compiles on JDK15+ --- .../netty/handler/ssl/util/OpenJdkSelfSignedCertGenerator.java | 3 ++- pom.xml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/handler/src/main/java/io/netty/handler/ssl/util/OpenJdkSelfSignedCertGenerator.java b/handler/src/main/java/io/netty/handler/ssl/util/OpenJdkSelfSignedCertGenerator.java index 32ad3b726de..bbe5e1f85e8 100644 --- a/handler/src/main/java/io/netty/handler/ssl/util/OpenJdkSelfSignedCertGenerator.java +++ b/handler/src/main/java/io/netty/handler/ssl/util/OpenJdkSelfSignedCertGenerator.java @@ -66,7 +66,8 @@ static String[] generate(String fqdn, KeyPair keypair, SecureRandom random, Date info.set(X509CertInfo.VALIDITY, new CertificateValidity(notBefore, notAfter)); info.set(X509CertInfo.KEY, new CertificateX509Key(keypair.getPublic())); info.set(X509CertInfo.ALGORITHM_ID, - new CertificateAlgorithmId(new AlgorithmId(AlgorithmId.sha256WithRSAEncryption_oid))); + // sha256WithRSAEncryption + new CertificateAlgorithmId(AlgorithmId.get("1.2.840.113549.1.1.11"))); // Sign the cert to identify the algorithm that's used. X509CertImpl cert = new X509CertImpl(info); diff --git a/pom.xml b/pom.xml index b60b4da3484..1f3d0a357b9 100644 --- a/pom.xml +++ b/pom.xml @@ -97,7 +97,7 @@ - + java15 @@ -118,6 +118,7 @@ true + java14