diff --git a/mnet/lib.php b/mnet/lib.php index e878964b72c..3937b4491f3 100644 --- a/mnet/lib.php +++ b/mnet/lib.php @@ -259,7 +259,7 @@ function mnet_encrypt_message($message, $remote_certificate) { // Generate a key resource from the remote_certificate text string $publickey = openssl_get_publickey($remote_certificate); - if ( gettype($publickey) != 'resource' ) { + if ($publickey === false) { // Remote certificate is faulty. return false; }