Good day.
There is a java method wrapped into an Oracle stored procedure. The method creates a connection to the https URL (SSL), with the exception "Could not generate DH keypair". Those. Java "embedded" works in Orcale 11g (jre 1.6).
In the usual java (not built into the oracle db) this is "treated" either by replacing the "Unlimited Strength policy" or by adding the JCE provider (usually recommended by Bouncy Castle).
And how to do it in the built-in database Oracel java?
I tried to put the policy files in ORACLE_HOME/jdr/jre/lib/security - it does not help ...
I checked the set of providers in ORACLE_HOME/jdr/jre/lib/security/java.security and the providers obtained from java.security.Security.getProviders() - they differ. This suggests that java is built into the database of Oracle lives on some of its own "laws."
import org.bouncycastle.jce.provider;. This makes it possible to add a JCE provider "on the fly" at runtime:java.security.Security.insertProviderAt(new org.bouncycastle.jce.provider.BouncyCastleProvider(),1);. Do this before the connection is opened - that. e. BEFORE callingHttpsUrlConnection.connect()or.getInputStream(). - Ch.PavelSocket), then the material from the Using BouncyCastle for a simple HTTPS query is very useful. - Ch.Paveljava.security.Security.insertProviderAt). At the same time, sending the data toInpotStreamobtained, and when trying to subtract a response from theoutputStreaman error occurs in thejava.lang.ArrayIndexOutOfBoundsExceptionarchive. Why is it still a mystery ... - Ch.Pavel