Skip to content

API client still does not work properly with OpenSSL, still complains about missing mcrypt? #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
litebito opened this issue Feb 1, 2025 · 1 comment

Comments

@litebito
Copy link

litebito commented Feb 1, 2025

Hi,

I'm surprised (and frustrated) this is still an issue? It is still not solved.
Anyone working with the API who has a working solution with OpenSSL ?

In class.phpipam-api.php, I still see the reference to mcrypt being a requirement

(around line 363)

 /**
     * Check if all extensions are present
     *
     * @access private
     * @return void
     */
    private function validate_php_extensions () {
        // Required extensions
        $required_ext  = array("openssl", "curl");
        // mcrypt for crypted extensions
        if($this->api_key !== false)
            $required_ext[] = "mcrypt";
        // json
        if($this->result_format == "json")
            $required_ext[] = "json";
        // xml
        if($this->result_format == "xml")
            $required_ext[] = "xmlreader";

        // Available extensions
        $available_ext = get_loaded_extensions();

        // check
        foreach ($required_ext as $e) {
            if(!in_array($e, $available_ext)) {
                $this->exception("Missing php extension ($e)");
            }
        }
    }
@litebito
Copy link
Author

litebito commented Feb 1, 2025

Solution seems to be to
replace the line

$required_ext[] = "mcrypt";

with

$required_ext[] = "openssl";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant