The Oracle Lite Blog

The Rekounas Blog about Oracle's Mobile Enterprise Application Platform

The Oracle Lite Blog header image 2

String encryption and Webtogo

March 17th, 2007 · No Comments

A couple of weeks ago, I upgraded my client JRE from 1.4.2_03 to 1.4.2_13. When I did this, the Cipher encryption on my site started throwing an exception:

java.lang.NoClassDefFoundError at javax.crypto.Cipher.getInstance(DashoA6275)

So, I opened a metalink ticket and was able to resolve the issue by adding the following parameter to the webtogo.ora file on my client:

[WEBTOGO]
NO_URL_FACTORY=YES

I haven’t found any documentation on this parameter. But a fellow developer seems to have an idea. He wrote to me:

1. java.lang.ExceptionInInitializerError
at javax.crypto.Cipher.a(DashoA12275)
at javax.crypto.Cipher.getInstance(DashoA12275)
at com.gm.gwm.common.util.AesUtil.encrypt(AesUtil.java:17)
at Caused by: java.lang.SecurityException: Cannot set up certs for

2. trusted CAs
at javax.crypto.SunJCE_b.(DashoA12275)

3. Caused by: java.lang.IllegalStateException: Already connected
at java.net.URLConnection.setUseCaches(Unknown Source)
at sun.net.www.protocol.jar.JarURLConnection.setUseCaches

Exception #1…
The AES cipher blows up because can’t load the signed certificate authorities.

Exception #2…
The trusted CAs don’t load because setUseCaches() is being called after a connection.

Finally Exception #3…
JavaDoc…
public void setUseCaches(boolean usecaches)
Parameters:
usecaches – a boolean indicating whether or not to allow caching
Throws:
IllegalStateException – if already connected

We finally reach the bottom and realize that what is happening is that web-to-go is making a connection to the remote server and then using setUseCaches()… bad Oracle, bad boy!

My guess Greg, is that previous they were able to get away with this but then Sun fixed the issue after patch 03. I looked at the AES code and it looks OK and I even took a look at the cacerts (Certificate Authority signed certificates) to ensure they were valid.

Share

Tags: Java · Webtogo

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment

*