Skip to main content

Problem:

Why corbaloc cannot be used with security?

Resolution:


Product Name:VisiBroker
Product Version:All versions
Product Component:Licensing
Platform/ OS version:All platforms


Problem Description

corbaloc URL cannot be used to bootstrap to a naming service when security is used. When using corbaloc mechanism between client and server without the security enabled, the server throws a ForwardRequest to client with the real object reference. The client then uses the actual IOR to do the binding.

When security is enabled, Naming Service IOR has a SSL component tagged in it. When using corbaloc, this security component is not embedded in its IOR. Since it does not hold the actual IOR, using corbaloc with security fails.


Resolution

Method 1: Using properties

Specify the actual IOR in the property itself.

e.g. Client -DORBDefaultInitRef=NameService=

or

e.g. Client -DORBDefaultInitRef=NameService=’cat ns.ior’


Method 2: Using the program

The IOR file can also be passed programmatically to prevent hard coding of the IOR contents and command line passage. Please see below for example code.

==========Start of sample code===========
// Read naming service object reference from file
ifstream in("ns.ior");
char ior[MAXBUF];
in.getline(ior, MAXBUF);
in.close();

// convert the naming service object reference stringified IOR to an object reference
CORBA::Object_var object = orb->string_to_object(ior);

// get a reference to the Naming Service root_context
CosNaming::NamingContext_var rootContext = CosNaming::NamingContext::_narrow(object);
=============End of sample code===============

Author: Anitha Deenadayalan

Old KB# 26245

#Security
#VisiBroker