diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Glacier2/SessionRouterI.cpp | 43 | ||||
-rwxr-xr-x | cpp/src/Glacier2/glacier2router.dsp | 4 | ||||
-rw-r--r-- | cpp/src/Ice/Network.cpp | 2 | ||||
-rw-r--r-- | cpp/src/Ice/Network.h | 1 |
4 files changed, 42 insertions, 8 deletions
diff --git a/cpp/src/Glacier2/SessionRouterI.cpp b/cpp/src/Glacier2/SessionRouterI.cpp index 87ff6b86426..8d34a4139c0 100644 --- a/cpp/src/Glacier2/SessionRouterI.cpp +++ b/cpp/src/Glacier2/SessionRouterI.cpp @@ -14,6 +14,9 @@ #include <IceUtil/UUID.h> +#include <IceSSL/Plugin.h> +#include <Ice/Network.h> + using namespace std; using namespace Ice; using namespace Glacier2; @@ -338,6 +341,36 @@ Glacier2::SessionRouterI::createSession(const std::string& userId, const std::st _pending.insert(current.con); } + Ice::Context ctx = current.ctx; + + // + // Populate the SSL context information. + // + try + { + IceSSL::ConnectionInfo info = IceSSL::getConnectionInfo(current.con); + ctx["SSL.Active"] = "1"; + ctx["SSL.Cipher"] = info.cipher; + ostringstream os; + os << ntohs(info.remoteAddr.sin_port); + ctx["SSL.Remote.Port"] = os.str(); + ctx["SSL.Remote.Host"] = IceInternal::inetAddrToString(info.remoteAddr.sin_addr); + os.str(""); + os << ntohs(info.localAddr.sin_port); + ctx["SSL.Local.Port"] = os.str(); + ctx["SSL.Local.Host"] = IceInternal::inetAddrToString(info.localAddr.sin_addr); + try + { + ctx["SSL.PeerCert"] = info.certs[0]->getPEMEncoding(); + } + catch(const IceSSL::CertificateEncodingException&) + { + } + } + catch(const IceSSL::ConnectionInvalidException&) + { + } + try { // @@ -345,10 +378,10 @@ Glacier2::SessionRouterI::createSession(const std::string& userId, const std::st // string reason; bool ok; - + try { - ok = _verifier->checkPermissions(userId, password, reason, current.ctx); + ok = _verifier->checkPermissions(userId, password, reason, ctx); } catch(const Exception& ex) { @@ -400,11 +433,11 @@ Glacier2::SessionRouterI::createSession(const std::string& userId, const std::st SessionControlPrx control; if(_adminAdapter) { - control = SessionControlPrx::uncheckedCast(_adminAdapter->addWithUUID( - new SessionControlI(this, current.con))); + control = SessionControlPrx::uncheckedCast( + _adminAdapter->addWithUUID(new SessionControlI(this, current.con))); controlId = control->ice_getIdentity(); } - session = _sessionManager->create(userId, control, current.ctx); + session = _sessionManager->create(userId, control, ctx); } // diff --git a/cpp/src/Glacier2/glacier2router.dsp b/cpp/src/Glacier2/glacier2router.dsp index 34c32b92a3f..2181f9dccf2 100755 --- a/cpp/src/Glacier2/glacier2router.dsp +++ b/cpp/src/Glacier2/glacier2router.dsp @@ -51,7 +51,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 libeay32.lib pcre.lib /nologo /subsystem:console /pdb:none /machine:I386 /FIXED:no
+# ADD LINK32 pcre.lib ws2_32.lib libeay32.lib /nologo /subsystem:console /pdb:none /machine:I386 /FIXED:no
# SUBTRACT LINK32 /debug /nodefaultlib
# Begin Special Build Tool
OutDir=.\Release
@@ -83,7 +83,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 libeay32.lib pcred.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /FIXED:no
+# ADD LINK32 pcred.lib ws2_32.lib libeay32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /FIXED:no
# SUBTRACT LINK32 /pdb:none
# Begin Special Build Tool
OutDir=.\Debug
diff --git a/cpp/src/Ice/Network.cpp b/cpp/src/Ice/Network.cpp index 201d63f5bbe..fff635e1f13 100644 --- a/cpp/src/Ice/Network.cpp +++ b/cpp/src/Ice/Network.cpp @@ -34,7 +34,7 @@ using namespace IceInternal; static IceUtil::StaticMutex inetMutex = ICE_STATIC_MUTEX_INITIALIZER; string -inetAddrToString(const struct in_addr& in) +IceInternal::inetAddrToString(const struct in_addr& in) { // // inet_ntoa uses static memory on some platforms so we protect diff --git a/cpp/src/Ice/Network.h b/cpp/src/Ice/Network.h index f81fc8c03e8..b5cf02d8f80 100644 --- a/cpp/src/Ice/Network.h +++ b/cpp/src/Ice/Network.h @@ -121,6 +121,7 @@ ICE_API bool isPeerLocal(SOCKET); #endif ICE_API int getSocketErrno(); +ICE_API std::string inetAddrToString(const struct in_addr&); } |