Skip to content

Commit

Permalink
Improve user experience.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Apr 23, 2015
1 parent 8af06ae commit 8d8842b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions core/src/main/java/org/jruby/Ruby.java
Expand Up @@ -149,6 +149,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.net.BindException;
import java.net.MalformedURLException;
Expand Down Expand Up @@ -1257,6 +1258,20 @@ private void init() {
loadService.require("jruby");
}

// attempt to enable unlimited-strength crypto on OpenJDK
try {
Class jceSecurity = Class.forName("javax.crypto.JceSecurity");
Field isRestricted = jceSecurity.getField("isRestricted");
isRestricted.setAccessible(true);
isRestricted.set(null, false);
isRestricted.setAccessible(false);

This comment has been minimized.

Copy link
@Lesiuk

Lesiuk Apr 28, 2015

You dont have to use setAccessible(false). With setAccessible() you change the behavior of the Field instance, but not the actual field of the class.

This comment has been minimized.

Copy link
@headius

headius Apr 28, 2015

Author Member

Yes, but I figured I'd be a better JVM citizen if I did what I needed and put it back the same way as before.

} catch (Exception e) {
if (isDebug()) {
System.err.println("unable to enable unlimited-strength crypto");
e.printStackTrace();
}
}

// out of base boot mode
booting = false;

Expand Down

1 comment on commit 8d8842b

@kares
Copy link
Member

@kares kares commented on 8d8842b Apr 24, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😋

Please sign in to comment.