Skip to content
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

error:02001003:system library:fopen:No such process #159

Closed
1 task
sankarcn opened this issue Sep 3, 2018 · 1 comment
Closed
1 task

error:02001003:system library:fopen:No such process #159

sankarcn opened this issue Sep 3, 2018 · 1 comment

Comments

@sankarcn
Copy link

sankarcn commented Sep 3, 2018

Steps to reproduce:

** Note... This might be a config issue on my side. But request you to please help. I am clueless on how to fix this.

  1. I tried to create an installation context based on the advice given.
    require_once DIR . '/vendor/autoload.php';
    use bunq\Context\ApiContext;
    use bunq\Util\BunqEnumApiEnvironmentType;

$environmentType = BunqEnumApiEnvironmentType::SANDBOX(); // Can also be BunqEnumApiEnvironmentType::PRODUCTION();
$apiKey = 'XXXXXXX'; // Replace with your API key
$deviceDescription = 'Testing of BUNQ'; // Replace with your device description
$permittedIps = ['0.0.0.0']; // List the real expected IPs of this device or leave empty to use the current IP

$apiContext = ApiContext::create(
$environmentType,
$apiKey,
$deviceDescription,
$permittedIps
);

BunqContext::loadApiContext($apiContext);
$fileName = 'bunq.cfg'; // Replace with your own secure location to store the API context details
$apiContext->save($fileName);

What should happen:

  1. Installation Context file should have been generated

What happens:

1.openssl_pkey_new() Line 61 in KeyPair.pho is failing, most likely because it is not able to get the openssl.cnf file.

Traceback

The first line below is an echo I did of openssl_error_string();

error:02001003:system library:fopen:No such process
Fatal error: Uncaught bunq\Exception\BunqException: Generating a new private key failed. See "http://php.net/manual/en/function.openssl-pkey-new.php" for more info. in C:\xampp\htdocs\vendor\bunq\sdk_php\src\Security\KeyPair.php:67 Stack trace: #0 C:\xampp\htdocs\vendor\bunq\sdk_php\src\Context\ApiContext.php(143): bunq\Security\KeyPair::generate() #1 C:\xampp\htdocs\vendor\bunq\sdk_php\src\Context\ApiContext.php(134): bunq\Context\ApiContext->initializeInstallationContext() #2 C:\xampp\htdocs\vendor\bunq\sdk_php\src\Context\ApiContext.php(115): bunq\Context\ApiContext->initialize('Testing of BUNQ', Array) #3 C:\xampp\htdocs\CreateContext.php(15): bunq\Context\ApiContext::create(Object(bunq\Util\BunqEnumApiEnvironmentType), '9ffd9b6efcecf02...', 'Testing of BUNQ', Array) #4 {main} thrown in C:\xampp\htdocs\vendor\bunq\sdk_php\src\Security\KeyPair.php on line 67

SDK version and environment

  • Tested on Latest version
  • Sandbox

Response id

  • Response id:

Extra info:

@sankarcn
Copy link
Author

sankarcn commented Sep 3, 2018

Fixed it by explicitly passing the config path... Getting a 400 error as response from BUNQ now. Will have to debug that...
$opensslConfigPath = "C:/xampp/php/extras/ssl/openssl.cnf";
$opensslKeyPair = openssl_pkey_new([
"config" => $opensslConfigPath,
self::FIELD_KEY_ALGORITHM => self::PRIVATE_KEY_ALGORITHM,
self::FIELD_KEY_LENGTH => self::PRIVATE_KEY_LENGTH,
self::FIELD_KEY_TYPE => OPENSSL_KEYTYPE_RSA

@sankarcn sankarcn closed this as completed Sep 4, 2018
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