Fix for OpenSSL::Cipher::CipherError in Rails 4 with JRuby
OpenSSL::Cipher::CipherError in DealsController#index
Illegal key size: possibly you need to install Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files for your JRE
Rails.root: /Users/irio/Code/gardener
Application Trace | Framework Trace | Full Trace
org/jruby/ext/openssl/Cipher.java:700:in `update'
There's already a wiki page in JRuby project reporting the why's: https://github.com/jruby/jruby/wiki/UnlimitedStrengthCrypto
Let's see the how.
- Download Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files.
- Unzip it.
- Find folders where policy files are located (see below).
- Backup current policies (
*.jar
files). - Copy unzipped
local_policy.jar
andUS_export_policy.jar
to the listed folders, replacing the existent ones.
Restart your Rails app and enjoy it working again.
$ cd /Library/Java/JavaVirtualMachines
$ find . -name 'local_policy.jar'
./jdk1.8.0_40.jdk/Contents/Home/jre/lib/security/local_policy.jar
Written by Irio Musskopf
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#