File tree 1 file changed +11
-3
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 52
52
import com .oracle .graal .python .runtime .PythonImageBuildOptions ;
53
53
54
54
public 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
+
55
64
@ Override
56
65
public void afterRegistration (AfterRegistrationAccess access ) {
57
66
if (!PythonImageBuildOptions .WITHOUT_SSL ) {
58
67
RuntimeClassInitializationSupport support = ImageSingletons .lookup (RuntimeClassInitializationSupport .class );
59
68
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
63
71
support .initializeAtRunTime ("org.bouncycastle" , "security provider" );
64
72
Security .addProvider (new BouncyCastleProvider ());
65
73
} else {
You can’t perform that action at this time.
0 commit comments