"Unable to sign data." error on windows server

Created on 21 May 2025, 16 days ago

Problem/Motivation

Kept getting - "Unable to sign data."

Steps to reproduce

I'm not sure that this isn't an issue specific to my setup - otherwise it would have been reported before.
Anyway, my config is:
- Windows IIS server (not my choice)
- PHP 8.1.19 with opensssl
- Drupal 10.4.4
- oauth2-server-php v. 1.10.0

Proposed resolution

The issue was that the generation of the private key kept failing. I manage to fix it by replacing
openssl_pkey_export($resource, $private_key);
with
openssl_pkey_export($resource, $private_key, null, $config);

I'll be submitting a PR.

I don't think this will be useful for usual LAMP setups, but I am also assuming that this change won't have any impact on it either, so if it can save someone a headache I think it's worth to add it to the module.

Remaining tasks

Validate that there's no impact on setups.

🐛 Bug report
Status

Active

Version

2.1

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024