|
|
|
|||||
|
Passing SSL connection details to application
I am currently finishing off an SSL plugin for IceCS (C#).
One of the things I would like to do is pass client certificate information for a connection to the application, that is, through Ice.Current.con(). Now, a generic way to do so would be to add an (opaque) member to Connection, such as (in C# syntax): Code:
public interface _ConnectionOperationsNC
{
...
object info(); <-- new member
}
to the Transceiver interface, and the method implemention in the ConnectionI class would be: Code:
public object info()
{
return _transceiver.info();
}
can then implement its info() method in any way it sees fit. All the application needs to do is cast the object back to a known type. Example (I modified the Hello server to show the name on the client certificate): Code:
public override void sayHello(Ice.Current current)
{
string msg = string.Empty;
SslStream ssl = current.con.info() as SslStream;
if (ssl != null) {
X509Certificate cert = ssl.RemoteCertificate;
msg = cert.Subject + " says: ";
}
msg += "Hello World!";
System.Console.Out.WriteLine(msg);
}
Karl |
|
|||||
|
Quote:
Quote:
Is the Session demo a good way to test the thread-pool model with SslStream? Karl |
|
||||||
|
Hi,
In my contrived example, plugins would define their own derived interfaces. Regarding the thread pool: I'm not familiar with the SslStream functionality in .NET 2.0, but you mentioned it only supported blocking operations. The thread pool uses non-blocking sockets, so it's quite possible that the thread pool will not behave properly when using an SslStream. There is a similar situation in Java, because the SSL interfaces in J2SE 1.4 do not support select-style functionality, therefore the IceSSL plugin for Java can only be used in thread-per-connection mode. - Mark |
|
|||||
|
Quote:
I have it working right now like you suggested. So, I am able to get at lower level information to extract client authentication info. That is fine if the SSL endpoint is at the server. Now I am faced with a more general problem: What if I use Glacier2? The server will not have an SSL endpoint directly connected to the client anymore. I haven't been able to figure out a way how the existinig Glacier2 would be able to forward such client credentials information. And even if it was modified to somehow add information to the context, this would not be an elegant solution, as the server now would have *two* ways to access that info, either using the TransportInfo interface, or reading the context. This almost looks like the proper way would be to establish some "secure circuit" between client and server, regardless of underlying transport. But then the use of SSL would be redundant. There is an OMG spec called SECP, but it appears quite complex. Quote:
Karl |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| passing objects | nicole | Help Center | 5 | 02-12-2007 10:12 PM |
| Problem passing context map with createSession() | bartley | Help Center | 6 | 02-02-2006 11:39 PM |
| Passing parameters to constructor | jacopo | Help Center | 2 | 05-12-2005 01:47 PM |
| passing a context to a locator | robert | Help Center | 4 | 10-23-2004 12:26 PM |