Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not build with JDK 20 #367

Open
xuwei-k opened this issue Apr 4, 2023 · 1 comment
Open

Could not build with JDK 20 #367

xuwei-k opened this issue Apr 4, 2023 · 1 comment

Comments

@xuwei-k
Copy link
Contributor

xuwei-k commented Apr 4, 2023

[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeChainedKeyStore.scala:111:14: value set is not a member of sun.security.x509.X509CertInfo
[error]     certInfo.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(new BigInteger(64, new SecureRandom())))
[error]              ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeChainedKeyStore.scala:112:14: value set is not a member of sun.security.x509.X509CertInfo
[error]     certInfo.set(X509CertInfo.VERSION, new CertificateVersion(CertificateVersion.V3))
[error]              ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeChainedKeyStore.scala:118:14: value set is not a member of sun.security.x509.X509CertInfo
[error]     certInfo.set(X509CertInfo.VALIDITY, validity)
[error]              ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeChainedKeyStore.scala:122:14: value set is not a member of sun.security.x509.X509CertInfo
[error]     certInfo.set(X509CertInfo.ISSUER, certificateAuthorityName)
[error]              ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeChainedKeyStore.scala:124:14: value set is not a member of sun.security.x509.X509CertInfo
[error]     certInfo.set(X509CertInfo.SUBJECT, owner)
[error]              ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeChainedKeyStore.scala:127:14: value set is not a member of sun.security.x509.X509CertInfo
[error]     certInfo.set(X509CertInfo.KEY, new CertificateX509Key(userKeyPair.getPublic))
[error]              ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeChainedKeyStore.scala:129:14: value set is not a member of sun.security.x509.X509CertInfo
[error]     certInfo.set(X509CertInfo.ALGORITHM_ID, new CertificateAlgorithmId(algorithm))
[error]              ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeChainedKeyStore.scala:132:16: overloaded method constructor X509CertImpl with alternatives:
[error]   (x$1: java.io.InputStream)sun.security.x509.X509CertImpl <and>
[error]   (x$1: sun.security.util.DerValue)sun.security.x509.X509CertImpl <and>
[error]   (x$1: Array[Byte])sun.security.x509.X509CertImpl
[error]  cannot be applied to (sun.security.x509.X509CertInfo)
[error]     val cert = new X509CertImpl(certInfo)
[error]                ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeChainedKeyStore.scala:138:14: value set is not a member of sun.security.x509.X509CertInfo
[error]     certInfo.set(CertificateAlgorithmId.NAME + "." + CertificateAlgorithmId.ALGORITHM, actualAlgorithm)
[error]              ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeChainedKeyStore.scala:138:77: value ALGORITHM is not a member of object sun.security.x509.CertificateAlgorithmId
[error]     certInfo.set(CertificateAlgorithmId.NAME + "." + CertificateAlgorithmId.ALGORITHM, actualAlgorithm)
[error]                                                                             ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeChainedKeyStore.scala:139:19: overloaded method constructor X509CertImpl with alternatives:
[error]   (x$1: java.io.InputStream)sun.security.x509.X509CertImpl <and>
[error]   (x$1: sun.security.util.DerValue)sun.security.x509.X509CertImpl <and>
[error]   (x$1: Array[Byte])sun.security.x509.X509CertImpl
[error]  cannot be applied to (sun.security.x509.X509CertInfo)
[error]     val newCert = new X509CertImpl(certInfo)
[error]                   ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeChainedKeyStore.scala:147:14: value set is not a member of sun.security.x509.X509CertInfo
[error]     certInfo.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(new BigInteger(64, new SecureRandom())))
[error]              ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeChainedKeyStore.scala:148:14: value set is not a member of sun.security.x509.X509CertInfo
[error]     certInfo.set(X509CertInfo.VERSION, new CertificateVersion(CertificateVersion.V3))
[error]              ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeChainedKeyStore.scala:154:14: value set is not a member of sun.security.x509.X509CertInfo
[error]     certInfo.set(X509CertInfo.VALIDITY, validity)
[error]              ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeChainedKeyStore.scala:158:14: value set is not a member of sun.security.x509.X509CertInfo
[error]     certInfo.set(X509CertInfo.SUBJECT, owner)
[error]              ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeChainedKeyStore.scala:159:14: value set is not a member of sun.security.x509.X509CertInfo
[error]     certInfo.set(X509CertInfo.ISSUER, owner)
[error]              ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeChainedKeyStore.scala:162:14: value set is not a member of sun.security.x509.X509CertInfo
[error]     certInfo.set(X509CertInfo.KEY, new CertificateX509Key(keyPair.getPublic))
[error]              ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeChainedKeyStore.scala:164:14: value set is not a member of sun.security.x509.X509CertInfo
[error]     certInfo.set(X509CertInfo.ALGORITHM_ID, new CertificateAlgorithmId(algorithm))
[error]              ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeChainedKeyStore.scala:167:17: value set is not a member of sun.security.x509.CertificateExtensions
[error]     caExtension.set(BasicConstraintsExtension.NAME, new BasicConstraintsExtension( /* isCritical */ true, /* isCA */ true, 0))
[error]                 ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeChainedKeyStore.scala:168:14: value set is not a member of sun.security.x509.X509CertInfo
[error]     certInfo.set(X509CertInfo.EXTENSIONS, caExtension)
[error]              ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeChainedKeyStore.scala:171:16: overloaded method constructor X509CertImpl with alternatives:
[error]   (x$1: java.io.InputStream)sun.security.x509.X509CertImpl <and>
[error]   (x$1: sun.security.util.DerValue)sun.security.x509.X509CertImpl <and>
[error]   (x$1: Array[Byte])sun.security.x509.X509CertImpl
[error]  cannot be applied to (sun.security.x509.X509CertInfo)
[error]     val cert = new X509CertImpl(certInfo)
[error]                ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeChainedKeyStore.scala:177:14: value set is not a member of sun.security.x509.X509CertInfo
[error]     certInfo.set(CertificateAlgorithmId.NAME + "." + CertificateAlgorithmId.ALGORITHM, actualAlgorithm)
[error]              ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeChainedKeyStore.scala:177:77: value ALGORITHM is not a member of object sun.security.x509.CertificateAlgorithmId
[error]     certInfo.set(CertificateAlgorithmId.NAME + "." + CertificateAlgorithmId.ALGORITHM, actualAlgorithm)
[error]                                                                             ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeChainedKeyStore.scala:178:19: overloaded method constructor X509CertImpl with alternatives:
[error]   (x$1: java.io.InputStream)sun.security.x509.X509CertImpl <and>
[error]   (x$1: sun.security.util.DerValue)sun.security.x509.X509CertImpl <and>
[error]   (x$1: Array[Byte])sun.security.x509.X509CertImpl
[error]  cannot be applied to (sun.security.x509.X509CertInfo)
[error]     val newCert = new X509CertImpl(certInfo)
[error]                   ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeKeyStore.scala:92:14: value set is not a member of sun.security.x509.X509CertInfo
[error]     certInfo.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(new BigInteger(64, new SecureRandom())))
[error]              ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeKeyStore.scala:93:14: value set is not a member of sun.security.x509.X509CertInfo
[error]     certInfo.set(X509CertInfo.VERSION, new CertificateVersion(CertificateVersion.V3))
[error]              ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeKeyStore.scala:99:14: value set is not a member of sun.security.x509.X509CertInfo
[error]     certInfo.set(X509CertInfo.VALIDITY, validity)
[error]              ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeKeyStore.scala:103:14: value set is not a member of sun.security.x509.X509CertInfo
[error]     certInfo.set(X509CertInfo.SUBJECT, owner)
[error]              ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeKeyStore.scala:104:14: value set is not a member of sun.security.x509.X509CertInfo
[error]     certInfo.set(X509CertInfo.ISSUER, owner)
[error]              ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeKeyStore.scala:107:14: value set is not a member of sun.security.x509.X509CertInfo
[error]     certInfo.set(X509CertInfo.KEY, new CertificateX509Key(keyPair.getPublic))
[error]              ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeKeyStore.scala:109:14: value set is not a member of sun.security.x509.X509CertInfo
[error]     certInfo.set(X509CertInfo.ALGORITHM_ID, new CertificateAlgorithmId(algorithm))
[error]              ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeKeyStore.scala:112:16: overloaded method constructor X509CertImpl with alternatives:
[error]   (x$1: java.io.InputStream)sun.security.x509.X509CertImpl <and>
[error]   (x$1: sun.security.util.DerValue)sun.security.x509.X509CertImpl <and>
[error]   (x$1: Array[Byte])sun.security.x509.X509CertImpl
[error]  cannot be applied to (sun.security.x509.X509CertInfo)
[error]     val cert = new X509CertImpl(certInfo)
[error]                ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeKeyStore.scala:118:14: value set is not a member of sun.security.x509.X509CertInfo
[error]     certInfo.set(CertificateAlgorithmId.NAME + "." + CertificateAlgorithmId.ALGORITHM, actualAlgorithm)
[error]              ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeKeyStore.scala:118:77: value ALGORITHM is not a member of object sun.security.x509.CertificateAlgorithmId
[error]     certInfo.set(CertificateAlgorithmId.NAME + "." + CertificateAlgorithmId.ALGORITHM, actualAlgorithm)
[error]                                                                             ^
[error] lightbend/ssl-config/ssl-config-core/src/main/scala/com/typesafe/sslconfig/ssl/FakeKeyStore.scala:119:19: overloaded method constructor X509CertImpl with alternatives:
[error]   (x$1: java.io.InputStream)sun.security.x509.X509CertImpl <and>
[error]   (x$1: sun.security.util.DerValue)sun.security.x509.X509CertImpl <and>
[error]   (x$1: Array[Byte])sun.security.x509.X509CertImpl
[error]  cannot be applied to (sun.security.x509.X509CertInfo)
[error]     val newCert = new X509CertImpl(certInfo)
[error]                   ^
[error] 35 errors found
[error] (sslConfigCore / Compile / compileIncremental) Compilation failed
@mkurz
Copy link
Contributor

mkurz commented Sep 13, 2023

I think this can be solved by creating multi-release jar files.
E.g. targeting Java 20+ we just need to use certInfo.setSerialNumber(...) instead of certInfo.set(X509CertInfo.SERIAL_NUMBER,...) and so on.

Alternative is to use bouncy castle like in #380 (I didn't review that pr however)

mkurz added a commit to mkurz/play-samples that referenced this issue Apr 29, 2024
Because of lightbend/ssl-config#367
Exception:
java.lang.IllegalArgumentException: GrpcClientSettings requires a server endpoint with ssl, but none provided
mkurz added a commit to mkurz/play-samples that referenced this issue Apr 29, 2024
Because of lightbend/ssl-config#367
Exception:
java.lang.IllegalArgumentException: GrpcClientSettings requires a server endpoint with ssl, but none provided
mkurz added a commit to mkurz/play-samples that referenced this issue Apr 29, 2024
Because of lightbend/ssl-config#367
Exception:
java.lang.IllegalArgumentException: GrpcClientSettings requires a server endpoint with ssl, but none provided
mkurz added a commit to mkurz/play-samples that referenced this issue Apr 29, 2024
Because of lightbend/ssl-config#367
Exception:
java.lang.IllegalArgumentException: GrpcClientSettings requires a server endpoint with ssl, but none provided
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants