We are trying to add an LTI 1.3 tool from an external provider and they have given us instructions and a custom URL to setup on the Plugins -> Activity Modules -> External Tools -> Manage Tools page. When we try to add the tool we receive an error saying "Exception - OpenSSL unable to sign data". When looking at the PHP log, we see the lines below:
PHP Warning: openssl_sign(): supplied key param cannot be coerced into a private key in C:\inetpub\wwwroot\moodle\lib\php-jwt\src\JWT.php on line 209
Default exception handler: Exception - OpenSSL unable to sign data Debug:
Error code: generalexceptionmessage
* line 211 of \lib\php-jwt\src\JWT.php: DomainException thrown
* line 180 of \lib\php-jwt\src\JWT.php: call to Firebase\JWT\JWT::sign()
* line 74 of \mod\lti\startltiadvregistration.php: call to Firebase\JWT\JWT::encode()
For some backgroup, we're running Moodle on:
OS: Windows Server 2012 R2
Web server: IIS 8
Moodle Version: 3.11.4
PHP Version: 7.4.27
I've added $CFG->opensslcnf = 'C:/PHP/extras/ssl/openssl.cnf'; to the config.php file, but I'm not 100% sure what the correct syntax is for the path since I've seen it a few different ways. I've also set an Environment Variable in Windows for OPENSSL_CONF to C:\PHP\extras\ssl\openssl.cnf, and made sure the openssl.dll PHP extension is enabled. Beyond that, I'm not sure what else to try.
Any help or suggestions would be much appreciated. Thanks.