[omniORB] programmatically see what transport used

Duncan Grisby duncan at grisby.org
Tue Jul 15 16:25:40 BST 2014


On Fri, 2014-07-11 at 09:22 +0200, Lukas Pirl wrote:

> We enabled SSL but cannot enforce it since we also have Java components 
> that do not support SSL.

Maybe you should get a Java ORB that supports SSL...

> Is there a possibility to for a component - in the role of the server - 
> to find out if a method call was done by using SSL or not?

You can use a serverReceiveRequest interceptor to get the peer address.
In omniORB 4.2.0, the interceptor info itself has a peeraddress()
method. With omniORB 4.1.x, you have to get hold of the connection
object to call its peeraddress() method:

CORBA::Boolean
peerInterceptor(omniInterceptors::serverReceiveRequest_T::info_T& info)
{
  const char* address;

  // In omniORB 4.2.0:
  address = info.peeraddress();

  // Or in omniORB 4.1.x:
  giopStrand& strand = info.giop_s.strand();
  address = strand.connection->peeraddress();

  // Now do something with address, perhaps put it in per-thread storage
}


The address will be of the form "giop:tcp:<ip>:<port>" or
"giop:ssl:<ip>:<port>".

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan at grisby.org     --
   -- http://www.grisby.org --





More information about the omniORB-list mailing list