示例#1
0
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;
        }
    } else {
        echo "Invalid method '" . $MYMETHOD . "' specified!\r\n";
        /* Free memory associated with conn */
        M_DestroyConn($conn);
        return;
 function MCVE_VerifySSLCert(&$conn, $tf)
 {
     return M_VerifySSLCert($conn, $tf);
 }