lxembi
09-10-2003, 04:30 PM
Hi everybody,
I need to use ISSL_NegotiateV to establish a SSL session, but don't know how exactly, seems there's no sample or detailed document around (sdk is not clear). Here goes my code, but apparently,it doesn't work. It will crash, not in this code, in system loops after the nagotiation set up. I'm sure the setup is wrong, but nowhere to find out a good reference.
/********************************************/
void ssl_callback(void * pData) {
int temp=1;
}
int ssl_nagotiate(ISocket *piSock) {
SSLInfo pSSLInfo;
ISSL *pISSL;
IX509Chain *pCerts;
AEECallback pcb;
IShell *piShell;
IWebOpts *piRoots;
WebOpt wb;
piShell = getShell();
if(ISHELL_CreateInstance(piShell, AEECLSID_SSL , (void **)&pISSL) != SUCCESS)
return -1;
if(ISHELL_CreateInstance(piShell, AEECLSID_SSLROOTCERTS , (void **)&piRoots) != SUCCESS)
return -1;
MEMSET(&pSSLInfo, 0, sizeof(SSLInfo));
MEMSET(&pcb, 0, sizeof(AEECallback));
pcb.pfnNotify = ssl_callback;
IWEBOPTS_GetOpt ( piRoots, WEBOPT_DEFAULTS, 0, &wb );
ISSL_SetSocket(pISSL, piSock);
ISSL_NegotiateV(pISSL, &pSSLInfo, &pCerts, &pcb, &wb);
return 0;
}
/******************************/
I need to use ISSL_NegotiateV to establish a SSL session, but don't know how exactly, seems there's no sample or detailed document around (sdk is not clear). Here goes my code, but apparently,it doesn't work. It will crash, not in this code, in system loops after the nagotiation set up. I'm sure the setup is wrong, but nowhere to find out a good reference.
/********************************************/
void ssl_callback(void * pData) {
int temp=1;
}
int ssl_nagotiate(ISocket *piSock) {
SSLInfo pSSLInfo;
ISSL *pISSL;
IX509Chain *pCerts;
AEECallback pcb;
IShell *piShell;
IWebOpts *piRoots;
WebOpt wb;
piShell = getShell();
if(ISHELL_CreateInstance(piShell, AEECLSID_SSL , (void **)&pISSL) != SUCCESS)
return -1;
if(ISHELL_CreateInstance(piShell, AEECLSID_SSLROOTCERTS , (void **)&piRoots) != SUCCESS)
return -1;
MEMSET(&pSSLInfo, 0, sizeof(SSLInfo));
MEMSET(&pcb, 0, sizeof(AEECallback));
pcb.pfnNotify = ssl_callback;
IWEBOPTS_GetOpt ( piRoots, WEBOPT_DEFAULTS, 0, &wb );
ISSL_SetSocket(pISSL, piSock);
ISSL_NegotiateV(pISSL, &pSSLInfo, &pCerts, &pcb, &wb);
return 0;
}
/******************************/