HP-UX C SIP Stack Programmer's Guide (Novembery 2007)

320 HP-UX C SIP Stack Programmers Guide
SIP Stack and TLS
RvInt certLen = TLS_CERT_STR_LENGTH;
RvStatus rv = RV_OK;
RvChar *pszCert = (RvChar*)&szCert;
/*Obtains the certificate as string from the certificate object.*/
rv = RvSipTransportTlsEncodeCert(certificate,&certLen,szCert);
if (RV_OK != rv)
{
HandleErrorFunction("failed to get certificate");
}
/*Converts the certificate to open SSL format.*/
pCert = d2i_X509(0,(unsigned char**)&pszCert,certLen);
sprintf(szLogData,"Cert Analysis - issuer:");
/*Who is the issuer of the certificate?*/
X509_NAME_oneline(X509_get_issuer_name(pCert),szTmpData,2048);
strcat(szLogData,szTmpData);
strcat(szLogData,", subject name: ");
/*Who is the subject of this certificate?*/
X509_NAME_oneline(X509_get_subject_name(pCert),szTmpData,2048);
strcat(szLogData,szTmpData);
/*Frees the certificate.*/
X509_free(pCert);
printf(szLogData);
/*Does not change the SSL pass/fail decision.*/
return prevError;
}
/*==================================================================================*/
TLS CONNECTION
S
TATES
The TLS Connection state machine represents the state of the TLS connection
between two SIP User Agents. The
RvSipTransportConnectionTlsStateChangedEv() callback reports TLS
connection state change.
The TLS connection associates with the following states: