Wednesday, September 23, 2009

SSL ISSUe :-javax.net.ssl.SSLHandshakeException: Received fatal alert: decrypt_error

Buzz this
I spent almost three days to figure out that why my code is throwing

-javax.net.ssl.SSLHandshakeException: Received fatal alert: decrypt_error

I tried all possible solution provided on Google , no help . finally one of my colleague told me a solution.If u face similar problem try following steps:-

1)Download latest certs from website u trying to connect over ssl

2)generate new cacerts.bin and replace new cacaerts.bin with old one and restart your app.

3)It must solve you problem

4)If u still face same issue

Go to :- cd /opt/jdk1.5.0_12/jre/lib/security

open java.security file

replace

security.provider.1=sun.security.provider.Sun
security.provider.2=com.sun.net.ssl.internal.ssl.Provider
security.provider.3=com.sun.rsajca.Provider

with

security.provider.1=sun.security.provider.Sun
security.provider.2=sun.security.rsa.SunRsaSign
security.provider.3=com.sun.net.ssl.internal.ssl.Provider
security.provider.4=com.sun.crypto.provider.SunJCE
security.provider.5=sun.security.jgss.SunProvider
security.provider.6=com.sun.security.sasl.Provider

and this must fix your problem.

Good luck !!

No comments: