web-push-libs / web-push-php

Web Push library for PHP
MIT License
1.69k stars 295 forks source link

Warning: hex2bin(): Hexadecimal input string must have an even length #331

Closed musaffar-patel closed 3 years ago

musaffar-patel commented 3 years ago

Hi

I am receiving the following error when running the test script (taken from the usage section of the readme.md)

Warning: hex2bin(): Hexadecimal input string must have an even length in E:\websites\test\push\vendor\minishlink\web-push\src\Encryption.php on line 294

Fatal error: Uncaught TypeError: Argument 1 passed to Minishlink\WebPush\Encryption::addNullPadding() must be of the type string, boolean given, called in E:\websites\test\push\vendor\minishlink\web-push\src\Encryption.php on line 294 and defined in E:\websites\test\push\vendor\minishlink\web-push\src\Encryption.php:421 Stack trace: #0 E:\websites\test\push\vendor\minishlink\web-push\src\Encryption.php(294): Minishlink\WebPush\Encryption::addNullPadding(false) #1 E:\websites\test\push\vendor\minishlink\web-push\src\Encryption.php(265): Minishlink\WebPush\Encryption::createLocalKeyObjectUsingPurePhpMethod() #2 E:\websites\test\push\vendor\minishlink\web-push\src\Encryption.php(65): Minishlink\WebPush\Encryption::createLocalKeyObject() #3 E:\websites\test\push\vendor\minishlink\web-push\src\WebPush.php(230): Minishlink\WebPush\Encryption::encrypt('\v\xD6\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...', 'BBFwt4l1ZvIoCkH...', 'wBDiu2sHF8wb5Zv...', 'aesgcm') #4 E:\websites\test\push\vendor\minishlink\web-push\src\WebPu in E:\websites\test\push\vendor\minishlink\web-push\src\Encryption.php on line 421

Php version 7.1.14 Windows 10

Any guidance on the issue would be appreciated.

Kind Regards Musaffar

AggelosGalatis commented 1 year ago

Did you find any solution about this problem?