HP-UX C SIP Stack Programmer's Guide (Novembery 2007)
Working with the Transport Layer 317
SIP Stack and TLS
/*Uses the initialized configuration to build the server TLS engine*./
rv = RvSipTransportTlsEngineConstruct(g_hTransportMgr,
&TlsEngineCfg,
sizeof(TlsEngineCfg),
&hTlsServerEngine);
if (RV_OK != rv)
{
HandleErrorFunction("failed to construct TLS server engine");
}
/*Makes sure that the private key matches the certificate installed on the engine.*/
rv = RvSipTransportTlsEngineCheckPrivateKey(g_hTransportMgr,hTlsServerEngine);
if (RV_OK != rv)
{
HandleErrorFunction("Key and private certificate don't match");
}
}
/*=========================================================================================*/
TLS CONNECTION A TLS connection is an entity that represents a TLS connection on which data
can be transmitted in a secure manner. When a TLS connection gets to the TCP
CONNECTED state, a TLS handshake can be initiated. When the TLS
handshake and positive connection assertion have been completed, data can be
transmitted on the connection.
TLS CONNECTION API A TLS connection is represented by the RvSipTransportConnectionHandle
handle. The TLS Connection API functions are as follows:
RvSipTransportConnectionTlsHandshake()
Moves the TLS connection from the HANDSHAKE_READY state to the
HANDSHAKE_STARTED state by starting a TLS handshake. The hEngine
parameter indicates which engine is responsible for this connections handshake.
One option is to examine the remote IP address of the connection, and using this
address, decide which engine is responsible for this handshake.
The pfnVerifyCertEvHandler parameter determines the certificate verification
callback. For more information on this callback, see the
RvSipTransportVerifyCertificateEv() paragraph in the callbacks section.
RvSipTransportConnectionGetCurrentTlsState()
Gets the current TLS state of a connection.