$conn = M_InitConn(); if ($conn === FALSE) { echo "Failed to initialize connection resource\r\n"; return; } if (strcasecmp($MYMETHOD, "SSL") == 0) { /* Set up SSL Connection Location */ if (!M_SetSSL($conn, $MYHOST, $MYPORT)) { echo "Could not set method to SSL\r\n"; /* Free memory associated with conn */ M_DestroyConn($conn); return; } /* Set up information required to verify certificates */ if ($MYVERIFYSSL) { if (!M_SetSSL_CAfile($conn, $MYCAFILE)) { echo "Could not set SSL CAFile. " . "Does the file exist?\r\n"; M_DestroyConn($conn); return; } M_VerifySSLCert($conn, 1); } } else { if (strcasecmp($MYMETHOD, "IP") == 0) { /* Set up IP Connection Location */ if (!M_SetIP($conn, $MYHOST, $MYPORT)) { echo "Could not set method to IP\r\n"; /* Free memory associated with conn */ M_DestroyConn($conn); return; }
function MCVE_SetSSL_CAfile(&$conn, $cafile) { return M_SetSSL_CAfile($conn, $cafile); }