- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
/*** First, attempting to establish a SSL-connection ***/
while(1)
{
sslConnection = sslConnect((const char *)remoteHost, port, CAFileName, CAPathName, error);
if(!sslConnection)
{
logger(ERR, "receiver: Can not establish SSL connection with %s [description - %s]", remoteHost, error);
#ifndef DEBUG_MODE
if (WaitForSingleObject (hExitEvent, 5000) == WAIT_OBJECT_0)
{
if(logLevel == DEBUG_LOG_LEVEL)
logger(INFO, "receiver: Exit event was set in signaling state");
logger(INFO, "receiver: Exit");
return(0);
}
#else
Sleep(5000);
#endif
continue;
}
else
{
if(logLevel == DEBUG_LOG_LEVEL)
{
logger(INFO, "receiver: Connection with %s is established", remoteHost);
}
socketError = 0;
break;
}
}
Пытаемся подключиться к серверу по SSL/TLS, отваливаемся по событию