#include <qsossl.h> char* SSL_Strerror(int sslreturnvalue, SSLErrorMsg* serrmsgp);Service Program Name: QSOSSLSR
The SSL_Strerror() function is used to retrieve an error message and associated text string which describes an SSL return value.
struct SSLErrorMsgStr { /* SSLErrorMsgStr */ char messageID[7]; /* Message identifier */ char messageFile[20]; /* Qualified message file name */ };
The fields within the SSLErrorMsg structure as pointed to by serrmsgp are defined as follows:
No authorization is required.
The SSL_Strerror() API returns a pointer to the string. The null-terminated string is stored in the CCSID of the job. If the serrmsgp is provided, the SSLErrorMsg struct will be updated to reflect the message information corresponding to the string returned.
If the sslreturnvalue is unrecognized, then an Unknown error message will be stored at the location pointed to by the return value. Other error conditions will be handled as described under Error Messages.
This API calls the Retrieve Message (QMHRTVM) API in order to perform its task. It inherits all error conditions from this function. If errors are encountered while using the Retrieve Message API, they will be reflected in the SSLErrorMsg fields (if provided) and any associated message replacement text will be stored at the location pointed to by the return value.
See Code disclaimer information for information pertaining to code examples.
The following example shows how SSL_Strerror() is used:
#include <stdio.h> #include <sys/types.h> #include <sys/socket.h> #include <qsossl.h> #include <netinet/in.h> #include <arpa/inet.h> #include <errno.h> /* bufferLen is 250 bytes */ #define bufferLen 250 void main() { int bufferLen, on = 1, rc = 0, sd, sd2, addrlen = 0; char buffer[bufferLen]; SSLInit sslinit; SSLHandle* sslh; struct sockaddr_in addr; unsigned short int cipher[3] = { SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_RC4_128_SHA, SSL_RSA_EXPORT_WITH_RC4_40_MD5 }; /*************************************************/ /* memset sslinit structure to hex zeros and */ /* fill in values for the sslinit structure */ /*************************************************/ memset((char *)&SSL_Init, 0x00, sizeof(sslinit)); sslinit.keyringFileName = "/keyringfile.kyr"; sslinit.keyringPassword = NULL; sslinit.cipherSuiteList = &cipher[0]; sslinit.cipherSuiteListLen = 3; /*************************************************/ /* initialize SSL security call SSL_Init */ /*************************************************/ if ((rc = SSL_Init(&sslinit)) != 0) { printf("SSL_Init() failed with rc = %d %s \n" "and errno = %d %s \n",rc,SSL_Strerror(rc, NULL), errno,strerror(errno)); } ... }
Top | UNIX-Type APIs | APIs by category |