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

Unlimited Strength Crypto "patch" #2224

Closed
codeodor opened this issue Nov 22, 2014 · 4 comments
Closed

Unlimited Strength Crypto "patch" #2224

codeodor opened this issue Nov 22, 2014 · 4 comments

Comments

@codeodor
Copy link

The programmatic way to fix the crypto restriction does get rid of the initial error message, but still fails for me due to another error related to not finding the algorithm.

This is with a Rails 4.2.0.beta4 app built on Mac OSX JRuby and deployed via executable WAR to Windows.

Installing the files worked fine, but I wonder if the programmatic instructions need some updating or clarification.

@headius
Copy link
Member

headius commented Nov 23, 2014

Can you show us the error you're getting with the crypto hack in place?

@codeodor
Copy link
Author

Let me uninstall Java and reinstall it hoping those 2 JARs go back to the original. I'll report back what I find.

@codeodor
Copy link
Author

Fresh install of Java 8 on Windows, move my warbler-created Rails WAR file over, run java -jar railsapp.war and load it up in the browser:

Illegal key size: possibly you need to install Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files for your JRE

Added the following code to initializers/java_crypto_patch.rb:

begin
  security_class = java.lang.Class.for_name('javax.crypto.JceSecurity')
  restricted_field = security_class.get_declared_field('isRestricted')
  restricted_field.accessible = true
  restricted_field.set nil, false
rescue java.lang.ClassNotFoundException
  puts "JCE security not available on this platform"
end

Ran warble executable war on the app again and moved it over to windows. Start the app, ....

And it works this time. Wow, now I wonder what caused the error before.

In any case, thanks for making me walk through it again, and sorry for wasting your time!

@headius
Copy link
Member

headius commented Nov 24, 2014

Thanks for confirming it at least! We always recommend latest JDK, so hopefully if there's any remaining problem it will fade with time.

@enebo enebo added this to the Invalid or Duplicate milestone Dec 8, 2014
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

3 participants