Server Authentication without Encryption
To use server authentication without data encryption (One-way SSL without encryption), follow the same procedure as in the previous example, but invoke the awSetDescriptorSSLEncrypted function before creating or reconnecting the Broker client, as shown in the following example:
. . .
static char *certfile = "NULL"; //NULL certificate file
static char *password = "NULL"; //NULL certificate file password
static char *trustfile = "trustfilepath";
BrokerConnectionDescriptor desc;
/* Create descriptor */
desc = awNewBrokerConnectionDescriptor();
if (desc == NULL) {
printf("Error on create descriptor\n");
return 0;
}
/* Enable Server authentication only */
err = awSetDescriptorSSLCertificate(desc,certfile,password,trustfile);
if (err != AW_NO_ERROR) {
printf("Error on setting SSL cert\n%s\n",
awErrorToCompleteString(err));
return 0;
}
/* Disable encryption */
err = awSetDescriptorSSLEncrypted(desc,FALSE);
if (err != AW_NO_ERROR) {
printf("Error on setting SSL encrypt flag\n%s\n",
awErrorToCompleteString(err));
return 0;
}
/* Create a client */
. . .