File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 5252import com .oracle .graal .python .runtime .PythonImageBuildOptions ;
5353
5454public class BouncyCastleFeature implements Feature {
55+
56+ /*
57+ * Will soon be default in native image. We'll still need the old way to support older
58+ * native-image in JDK 21. I guess then it would be something like:
59+ *
60+ * INITIALIZE_AT_RUNTIME = Runtime.version().feature() >= 26;
61+ */
62+ private static final boolean INITIALIZE_AT_RUNTIME = false ;
63+
5564 @ Override
5665 public void afterRegistration (AfterRegistrationAccess access ) {
5766 if (!PythonImageBuildOptions .WITHOUT_SSL ) {
5867 RuntimeClassInitializationSupport support = ImageSingletons .lookup (RuntimeClassInitializationSupport .class );
5968
60- if (Runtime .version ().feature () >= 25 ) {
61- // In current native image, security providers need to get verified at build time,
62- // but then are reinitialized at runtime
69+ if (INITIALIZE_AT_RUNTIME ) {
70+ // Verify at build time, but reinitialize at runtime
6371 support .initializeAtRunTime ("org.bouncycastle" , "security provider" );
6472 Security .addProvider (new BouncyCastleProvider ());
6573 } else {
You can’t perform that action at this time.
0 commit comments