Server and Client-side Authentication with Encryption
To use both server and client authentication with data encryption, invoke the awSetDescriptorSSLCertificate function with a valid certificate file, certificate file password, and a valid truststore file, as shown in the following example:
. . .
static char *certfile = "certfile";
static char *password = "mypassword";
static char *trustfile = "trustfile";
BrokerConnectionDescriptor desc;
/* Create descriptor */
desc = awNewBrokerConnectionDescriptor();
if (desc == NULL) {
printf("Error on create descriptor\n");
return 0;
}
/* Enable both Server and client authentication*/
err = awSetDescriptorSSLCertificate(desc,certfile,password,trustfile);
if (err != AW_NO_ERROR) {
printf("Error on setting SSL
cert\n%s\n",awErrorToCompleteString(err));
return 0;
}
/* Create a client */
. . .
}