Discussion:
[omniORB] programmatically see what transport used
Lukas Pirl
2014-07-11 07:22:49 UTC
Permalink
Hello mailing list,

we (a fellow student and me) have a simple P2P application using omniORB
with Python and C++. Everything works well so far.
(Thanks for omniORB, by the way!)

We enabled SSL but cannot enforce it since we also have Java components
that do not support 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?

Thanks in advance!

Lukas
Duncan Grisby
2014-07-15 15:25:40 UTC
Permalink
Post by Lukas Pirl
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...
Post by Lukas Pirl
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 --
Loading...