Monthly Archive: January 2010

Troubleshooting SSL issues

Signature verification failed because RSA key public exponent [3] is too small

RSA Keys with Public Exponent results in faulty signature verification on WLS. Having so low exponent is considered as security vulnerability; hence keys with low exponents are not supported by WLS. However if we need to bypass this behavior, we can use the following flag Illegal key size or default parameters

This exception is encountered while using strong encryption such as AES256. We can overcome this by downloading the unrestricted jurisdiction policy files from the JVM vendor site and place it under jre/lib/security folder.

NEW ALERT with Severity: FATAL, Type: 70

We get this alert when the the party communication with Weblogic Server is using a different version of SSL. We need to check the Handshake Message for the version of SSL used.

Using this flag to specify the version of SSL at WLS can be helpful.

NEW ALERT=with Severity: FATAL, Type: 42

This alert means that the certificate presented to WLS is not trusted. It can be resolved by importing the certificate into the trust store of Weblogic Server.

HANDSHAKE_FAILURE alert received from localhost –

Most of the time its because of HOST NAME VERIFICATION.
Ignore Host Name Verification by setting this flag for Admin & Managed Server

And this in the startNodeManager.cmd

Sometime when the root certificate does not meet the basic constraint, i.e. even when the issuer and the owner is the same, the criticality is not true

ObjectId: Criticality=false

To allow WLS to accept such certificates we need to pass on this flag PKIX: Unsupported OID in the AlgorithmIdentifier object: 1.2.840.113549.1.1.11

The root problem is the Certicom SSL does not support SHA256 algorithm, which is required with the trusted certificates of “ttelesecglobalrootclass2ca” and “ttelesecglobalrootclass3ca”

A fix is included in JDK 1.6.0_13 wherein WLS just ignores these certificates.

Trust failure (68): CERT_CHAIN_INCOMPLETE

We encounter this issue when the Weblogic Server is not able to verify the chain of certificates presented to it. From the debug message we can check the certificates and check their order in the chain. We can also check the trust store for the root and intermediate certificates on the signing authority of the certificates.
We can use this to validate the certificate chain using

java utils.ValidateCertChain -jks alias storefilename [storePass] the trustAnchors parameter must be non-empty

We need to specify the trustore as a JAVA OPTION
Or specify it as a System Property in the code


PKIX path building failed: unable to find valid certification path to requested target

Pass the keystore in the java options.

-Dssl.debug=true Illegal key size

Try adding the following jvm option. This will make Weblogic Server FIPS 140-2 compliant. Inbound closed before receiving peer’s close_notify: possible truncation attack?

This issue is fixed in 12.1.2
For 1035 and 1036 apply patch for BUG 13351178.

weblogic.wsee.jaxrpc.soapfault.WLSOAPFaultException: Failed to receive message FATAL Alert:BAD_CERTIFICATE – A corrupt or unuseable certificate was received.

Add the following JVM Options to the server

Upgrade the client to use the same version of Java 7 as the webservices.
Ensure that both the client and the webservices were using unlimited strength encryption. handshake alert:unrecognized_name

The issue is because of introduction of Server Name Indication in JAVA SE 7 update 2.
It can be disabled with the following flag.

To resolve it make sure your webserver has virtual hostname set correctly. Unable to process PreMasterSecret, may be too big” ?

This looks to a jdk isssue, following jdk bug matches the description.

Configuring OpenDS with Weblogic Server

Download Install and Configure OpenDS.

I used the following LDIF as BASE while installing OpenDS.

dn: dc=oracle,dc=com
dc: oracle
objectClass: domain
objectClass: top

dn: ou=TEST, dc=oracle,dc=com
ou: TEST
objectClass: organizationalUnit
objectClass: top

dn: cn=faisal,ou=TEST, dc=oracle,dc=com
uid: faisal
userPassword:: e1NTSEF9dnhBYUZKRzBONmwzWTdRMHBQRmdiczZrRHd5VUNwWCtCQTdlaHc9PQ
objectClass: person
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: top
givenName: Faisal
sn: Khan
cn: faisal

dn: cn=testuser,ou=TEST, dc=oracle,dc=com
uid: testuser
userPassword:: e1NTSEF9YXpZckZodWpla1FjWUNqcFJDQlRUeFRjOGNPa0NtaTF1a1hqWUE9PQ
objectClass: person
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: top
givenName: testuser
sn: testuser
cn: testuser

dn: cn=TestGroup,ou=TEST, dc=oracle,dc=com
description: TestGroup
objectClass: groupOfUniqueNames
objectClass: top
uniqueMember: cn=faisal,ou=TEST,dc=oracle,dc=com
cn: TestGroup

Create an LDAP Authenticator.

Home >Summary of Security Realms >myrealm >Providers > Create New LDAPAuthenticator.


In the Provider Specific Tab provide the following details:

PORT : 1389
Principal : cn=faisal,ou=TEST, dc=oracle,dc=com
User Base DN : ou=TEST, dc=oracle,dc=com
Credentials : XXXXXXXXXXX
Group Base DN : ou=TEST, dc=oracle,dc=com

Leave the rest as default.

Now go to

Home >Summary of Security Realms >myrealm >Providers >Realm Roles
Expand Global Roles -> Expand Roles -> Click on View Role Conditions of the Admin Role -> Click on Add Conditions -> Select User in Predicate List -> Click Next -> In User Argument Name ADD faisal and FINISH -> Click Save

Change the control flag of the Default Authenticator as SUFFICIENT.

Log out and log in as faisal !


<sec:authentication-provider xsi:type=”wls:ldap-authenticatorType”>
<wls:principal>cn=faisal,ou=TEST, dc=oracle,dc=com</wls:principal>
<wls:user-base-dn>ou=TEST, dc=oracle,dc=com</wls:user-base-dn>
<wls:group-base-dn>ou=TEST, dc=oracle,dc=com</wls:group-base-dn>


SSL Vulnerabilites

SSL Server allows Anonymous Authentication Vulnerability

This basically means that the client will be able to connect to the Server without using any authentication algorithm. Some SSL Ciphers allow anonymous authentication. Choosing the right cipher suites as explained in an earlier post, and disabling null cipher from the admin console can help mitigate this risk.

SSL Server Allows Clear text Communication Vulnerability

This vulnerability depends upon the cipher suites used, as some cipher suites allow clear text communication. If no cipher suite is specifically mentioned in the config.xml file, then the cipher suites that allow clear text communication are enabled (as well as those that do not allow clear text).

To prevent clear text communications, avoid TLS_RSA_WITH_NULL_MD5 and TLS_RSA_WITH_NULL_SHA, as these two cipher suites have 0 Symmetric Key Strength. For a list of allowed cipher suites, see the previous post. The values assigned here will allow 56 as well 128 bit encryption.

TLS Protocol Session Renegotiation Security Vulnerability

The details of the vulnerability can be found here
If u have applied the latest Critical Patch Update, you should b fine.
Find more details here

JMS Resources using JMX

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;

import javax.naming.Context;
import javax.naming.InitialContext;

import weblogic.j2ee.descriptor.wl.JMSBean;
import weblogic.j2ee.descriptor.wl.JMSConnectionFactoryBean;
import weblogic.j2ee.descriptor.wl.QueueBean;
import weblogic.jms.extensions.JMSModuleHelper;

public class JMSResource {

private static MBeanServerConnection connection;
private static JMXConnector connector;
private static ObjectName service;

static {

try {

service = new ObjectName(
“com.bea:Name=RuntimeService,” +
} catch (MalformedObjectNameException e) {
throw new AssertionError(e.getMessage());

public static void initConnection(String hostname, String portString,
String username, String password) throws IOException,
MalformedURLException {
String protocol = “t3”;
Integer portInteger = Integer.valueOf(portString);
int port = portInteger.intValue();
String jndiroot = “/jndi/”;
String mserver = “”;
JMXServiceURL serviceURL = new JMXServiceURL(protocol, hostname, port,
jndiroot + mserver);
Hashtable h = new Hashtable();
h.put(Context.SECURITY_PRINCIPAL, username);
h.put(Context.SECURITY_CREDENTIALS, password);
connector = JMXConnectorFactory.connect(serviceURL, h);
connection = connector.getMBeanServerConnection();

public static ObjectName[] getJMSServers() throws Exception {
ObjectName serverRuntime = (ObjectName) connection.getAttribute(
service, “ServerRuntime”);
ObjectName jmsRuntime = (ObjectName) connection.getAttribute(
serverRuntime, “JMSRuntime”);
ObjectName[] jmsServers = (ObjectName[]) connection.getAttribute(
jmsRuntime, “JMSServers”);
return jmsServers;

public static void testMethod() {

try {

Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, “weblogic.jndi.WLInitialContextFactory”);
env.put(Context.PROVIDER_URL, “t3://localhost:7001”);
env.put(Context.SECURITY_PRINCIPAL, “weblogic”);
env.put(Context.SECURITY_CREDENTIALS, “weblogic”);
Context ctx = new InitialContext(env);

ObjectName[] serverRT = getJMSServers();
int length = (int) serverRT.length;
System.out.println(“length:::” + length);

for (int i = 0; i < length; i++) {

System.out.println(“i:::” + i);

ObjectName[] queues = (ObjectName[]) connection.getAttribute(
serverRT[i], “Destinations”);

String jmsServerName = (String) connection.getAttribute(
serverRT[i], “Name”);
System.out.println(“JMS Server name:” + jmsServerName);

int queueCount = (int) queues.length;

for (int k = 0; k < queueCount; k++) {

String queueNameWithModule = (String) connection
.getAttribute(queues[k], “Name”);

Long messagesCurrentCount = (Long) connection.getAttribute(
queues[k], “MessagesCurrentCount”);
+ messagesCurrentCount);

String moduleName = queueNameWithModule.substring(0,
System.out.println(“JMS module Name:” + moduleName);
String resourceName = moduleName;
String queueName = queueNameWithModule
.substring(queueNameWithModule.indexOf(“!”) + 1);
System.out.println(“queueName” + queueName);

JMSSystemResourceMBean jmsSR = JMSModuleHelper
.findJMSSystemResource(ctx, resourceName);
JMSBean jmsBean = jmsSR.getJMSResource();
JMSConnectionFactoryBean[] connectionFactoryBean = jmsBean

int length1 = (int) connectionFactoryBean.length;

for (int j = 0; j < length1; j++) {

JMSConnectionFactoryBean jmsFactory = connectionFactoryBean[j];
+ jmsFactory.getJNDIName());

QueueBean[] queueBean = jmsBean.getQueues();
length = (int) queueBean.length;

for (int m = 0; m < length; m++) {

QueueBean queue = queueBean[m];

if (queueName != null
&& queueName.equals(queue.getName())) {
+ queue.getJNDIName());

} catch (Exception e) {


public static void main(String[] args) throws Exception {

String hostname = “localhost”;
String portString = “7001”;
String username = “weblogic”;
String password = “weblogic”;
System.out.println(“initializing conenction….”);
initConnection(hostname, portString, username, password);


Using Canned Policy with Weblogic Server.

package demo;

import weblogic.jws.WLHttpTransport;
import weblogic.jws.Policies;
import weblogic.jws.Policy;
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.soap.SOAPBinding;





public class SimpleWS {

public String sayHello(String s) {
return “Hello ” + s;

package demo;

import demo.*;

import java.util.ArrayList;
import java.util.List;
import javax.xml.rpc.Stub;


import weblogic.xml.crypto.wss.WSSecurityContext;
import weblogic.xml.crypto.wss.provider.CredentialProvider;

public class Client {
public static void main(String[] args) throws Throwable {

//client private key file
String keyFile = args[0];

//client certificate
String clientCertFile = args[1];

String wsdl = args[2];

// Standard JAX-RPC code to get a service and port type

SimpleWSService service = new SimpleWSService_Impl(wsdl);
SimpleWSPortType port = service.getSimpleWSServicePort();

//create emtpy list of credential providers
List credProviders = new ArrayList();

//Create client-side BinarySecurityToken credential provider that uses
// X.509 for identity, based on certificate and keys parameters
CredentialProvider cp = new ClientBSTCredentialProvider(clientCertFile, keyFile);

Stub stub = (Stub)port;

// Set stub property to point to list of credential providers
stub._setProperty(WSSecurityContext.CREDENTIAL_PROVIDER_LIST, credProviders);

new TrustManager(){
public boolean certificateCallback(X509Certificate[] chain, int validateErr){
return true;
} );

String response = port.sayHello(“World”);
System.out.println(“response = ” + response);


<project name=”SimpleWS” default=”all” basedir=”.”>

<property name=”ws.file” value=”SimpleWS” />
<property name=”ear.dir” value=”EAR” />
<property name=”client.dir” value=”Client-dir” />

<path id=”client.class.path”>
<pathelement path=”${client.dir}”/>
<pathelement path=”${java.class.path}”/>

<taskdef name=”jwsc”
classname=”” />

<taskdef name=”clientgen”
classname=”” />

<target name=”all” depends=”clean,server,client, deploy” />

<target name=”build” depends=”clean,server,client” />

<target name=”clean”>
<delete dir=”${ear.dir}”/>
<delete dir=”${client.dir}”/>

<target name=”server”>
<mkdir dir=”${ear.dir}”/>
<jws file=”${ws.file}.java” explode=”true”/>

<target name=”deploy”>
<wldeploy action=”deploy”
source=”${ear.dir}” user=”weblogic”
password=”weblogic” verbose=”true”
targets=”AdminServer” />

<target name=”redeploy”>
<wldeploy action=”redeploy” source=”${ear.dir}”
user=”weblogic” password=”weblogic” verbose=”true”
targets=”AdminServer” />

<target name=”client”>
<mkdir dir=”${client.dir}”/>
srcdir=”${client.dir}” destdir=”${client.dir}”
srcdir=”${basedir}” destdir=”${client.dir}”

<target name=”run” >
<java fork=”true”
failonerror=”true” >
<classpath refid=”client.class.path”/>
<arg line=”client-key-pkcs8.der client-cert.der http://localhost:7001/SimpleWSService/SimpleWSService?WSDL” />



Configure JCE Provider with Weblogic Server

Download any JCE Provider. These JCE providers provide additional cryptographic algorithms to secure the communication.
Bouncy castle is one such freely available JCE provider.

To configure it place the provider jar file in the java-home/jre/lib/ext/ folder and add the following line in file in the jre\lib\security folder.


Where n is the order of preference to be used by Weblogic Server when evaluating security providers.

Restart your Weblogic Server with SSL enabled.

Go through the snippet of the log files to see the additional cryptographic algorithms made available by configuring the JCE provider.