Has anybody seen this error and have any solution. Would really
appreciate
your help.
I get the error on the following line:
java.io.PrintWriter Out = new
java.io.PrintWriter(connection.getOutputStream());
java.io.IOException: Nonexportable ciphersuite requested
at weblogic.security.SSL.SSLSocket.clientInit(SSLSocket.java,
Compiled
Code)
at weblogic.security.SSL.SSLSocket.initialize(SSLSocket.java:217)
at weblogic.security.SSL.SSLSocket.<init>(SSLSocket.java, Compiled
Code)
at weblogic.net.http.HttpsClient.openServer(HttpsClient.java,
Compiled
Code)
at weblogic.net.http.HttpsClient.openServer(HttpsClient.java,
Compiled
Code)
at weblogic.net.http.HttpClient.<init>(HttpClient.java:85)
at weblogic.net.http.HttpsClient.<init>(HttpsClient.java:34)
at weblogic.net.http.HttpClient.New(HttpClient.java, Compiled Code)
at weblogic.net.http.HttpURLConnection.connect(HttpURLConnection.java,
Compiled Code)
at
weblogic.net.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:144)
The Code snippet is:
<Begin>
java.net.URL url = new java.net.URL(eidURL);
java.net.URLConnection connection = url.openConnection();
connection.setRequestProperty("Method", "POST");
connection.setDoOutput(true);
connection.setDoInput(true);
java.io.PrintWriter Out = new
java.io.PrintWriter(connection.getOutputStream());
<End>
On getting the above errors I cast everywhere I could to use
com.sun.net.ssl.HttpsURLConnection
And now it gives me a class cast exception, I presume at the same
statement
as earlier :
java.io.PrintWriter Out = new
java.io.PrintWriter(((com.sun.net.ssl.HttpsURLConnection)connection).getOutputStream());
An excerpt of the code is:
String Request = java.net.URLEncoder.encode(request);
System.setProperty("java.protocol.handler.pkgs",
"com.sun.net.ssl.internal.www.protocol");
java.security.Security.addProvider(new
com.sun.net.ssl.internal.ssl.Provider());
java.net.URL url = new java.net.URL(httpsURL);
// java.net.URLConnection connection = (java.net.URLConnection)
url.openConnection();
com.sun.net.ssl.HttpsURLConnection connection =
(com.sun.net.ssl.HttpsURLConnection) url.openConnection();
/* if (connection instanceof com.sun.net.ssl.HttpsURLConnection)
((com.sun.net.ssl.HttpsURLConnection)connection).setHostnameVerifier(new
NullHostnameVerifier());
*/
((com.sun.net.ssl.HttpsURLConnection)connection).setHostnameVerifier(new
NullHostnameVerifier());
((com.sun.net.ssl.HttpsURLConnection)connection).setRequestProperty("Method",
"POST");
((com.sun.net.ssl.HttpsURLConnection)connection).setDoOutput(true);
((com.sun.net.ssl.HttpsURLConnection)connection).setDoInput(true);
java.io.PrintWriter Out = new
java.io.PrintWriter(((com.sun.net.ssl.HttpsURLConnection)connection).getOutputStream());
Out.print("DATAIN="+Request);
Out.flush();
Out.close();
java.io.BufferedReader in = new java.io.BufferedReader(new
java.io.InputStreamReader(((com.sun.net.ssl.HttpsURLConnection)connection).getInputStream()));
//_________________________________________________________________________________________
/* This inner class is a null version which always returns true when
checking
the server certificate against the hostname of the server
we're
connecting to.
*/
static class NullHostnameVerifier implements
com.sun.net.ssl.HostnameVerifier {
public boolean verify(String urlHostname,String
certHostname) {
return true;
}
}
//_______________________________________________________________________________________
To make JSSE work on weblogic, I made the following changes:
In the Weblogic.policy and java.policy files to have :
permission java.util.PropertyPermission "java.protocol.handler.pkgs",
"write";
Made changes in java.security file to have :
security.provider.2=com.sun.net.ssl.internal.ssl.Provider
And made changes to the Weblogic.properties file to have
weblogic.security.SSLHandler.enable=false
Copied the jnet.jar jcert.jar and jsse.jar into the jre/lib/ext folder
and
put all the jars in the weblogic java classpath.
_____________________________________________________________________________________________
Thanks in advance for your help.