Finished changes to the linux client so that it can communicate
with the ATS via SSL.
This commit is contained in:
@@ -55,6 +55,7 @@ CFILES = ../authmech.c \
|
||||
../getpolicymsg.c \
|
||||
../gettokenmsg.c \
|
||||
../util.c \
|
||||
../invalidcert.c \
|
||||
rpc.c \
|
||||
platform.c
|
||||
|
||||
|
||||
@@ -29,9 +29,6 @@
|
||||
|
||||
//===[ Type definitions ]==================================================
|
||||
|
||||
#define INITIAL_RESPONSE_DATA_BUF_SIZE 1028
|
||||
#define INCREMENT_RESPONSE_DATA_BUF_SIZE 256
|
||||
|
||||
#define MAX_RPC_RETRIES 3
|
||||
|
||||
//===[ Function prototypes ]===============================================
|
||||
@@ -310,13 +307,14 @@ InternalRpc(
|
||||
// L2
|
||||
//=======================================================================--
|
||||
{
|
||||
#define CASA_STATUS_INVALID_SERVER_CERTIFICATE CASA_STATUS_UNSUCCESSFUL // temporary until casa_status.h is updated
|
||||
|
||||
CasaStatus retStatus;
|
||||
char *pPartialUrl;
|
||||
int partialUrlLen;
|
||||
char *pUrl;
|
||||
CURLcode curlResult;
|
||||
|
||||
|
||||
DbgTrace(1, "-InternalRpc- Start\n", 0);
|
||||
|
||||
// Initialize output parameters
|
||||
@@ -328,13 +326,42 @@ InternalRpc(
|
||||
{
|
||||
pPartialUrl = pSession->pPartialHttpsUrl;
|
||||
partialUrlLen = pSession->partialHttpsUrlLen;
|
||||
|
||||
// Check if we need to ignore invalid CERTS
|
||||
if (flags & ALLOW_INVALID_CERTS_RPC_FLAG)
|
||||
{
|
||||
if ((curlResult = curl_easy_setopt(pSession->hCurl, CURLOPT_SSL_VERIFYPEER, 0)) != CURLE_OK)
|
||||
{
|
||||
DbgTrace(0, "-InternalRpc- Error setting CURLOPT_SSL_VERIFYPEER, code = %d\n", curlResult);
|
||||
}
|
||||
|
||||
if ((curlResult = curl_easy_setopt(pSession->hCurl, CURLOPT_SSL_VERIFYHOST, 0)) != CURLE_OK)
|
||||
{
|
||||
DbgTrace(0, "-InternalRpc- Error setting CURLOPT_SSL_VERIFYHOST, code = %d\n", curlResult);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((curlResult = curl_easy_setopt(pSession->hCurl, CURLOPT_SSL_VERIFYPEER, 1)) != CURLE_OK)
|
||||
{
|
||||
DbgTrace(0, "-InternalRpc- Error setting CURLOPT_SSL_VERIFYPEER, code = %d\n", curlResult);
|
||||
}
|
||||
|
||||
if ((curlResult = curl_easy_setopt(pSession->hCurl, CURLOPT_SSL_VERIFYHOST, 2)) != CURLE_OK)
|
||||
{
|
||||
DbgTrace(0, "-InternalRpc- Error setting CURLOPT_SSL_VERIFYHOST, code = %d\n", curlResult);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
pPartialUrl = pSession->pPartialHttpUrl;
|
||||
partialUrlLen = pSession->partialHttpUrlLen;
|
||||
}
|
||||
|
||||
pUrl = (char*) malloc(partialUrlLen + strlen(pMethod) + 1);
|
||||
|
||||
if (pUrl)
|
||||
{
|
||||
strcpy(pUrl, pPartialUrl);
|
||||
|
||||
Reference in New Issue
Block a user