Path to openssl.cnf

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Path to openssl.cnf

Postby musicmaster » 14. August 2023 21:19

The software I am using (Prestashop) has suddenly started using the openssl_pkey_new() command.

The problem with that PHP command is that it needs a valid path to the openssl.cnf file. There is such a file in the /xampp/apache/conf directory. However, obviously no valid path to that file is available as openssl_pkey_new() returns an error on my installation.

My question is what is the best way to fix that. The PHP manual mentions something about Windows environment variables. However, I would rather not use those as I maintain several Xampp installations for different PHP versions.
musicmaster
 
Posts: 34
Joined: 07. July 2016 19:47
XAMPP version: latest
Operating System: Windows

Re: Path to openssl.cnf

Postby Nobbie » 15. August 2023 20:06

musicmaster wrote:My question is what is the best way to fix that.


There is no "best" way. The best way for YOU might not be the best way for ME.

As you dont like to use Windows Environment, you should go for the 3rd solution mentioned in the documentation:

From https://www.php.net/manual/en/openssl.installation.php

...

...

The file openssl.cnf will be assumed to be found in the default certificate area, as configured at the time that the openssl DLL was compiled. This is usually means that the default filename is C:\Program Files\Common Files\SSL\openssl.cnf (x64) or C:\Program Files (x86)\Common Files\SSL\openssl.cnf (x86), or, prior to PHP 7.4.0, C:\usr\local\ssl\openssl.cnf.


Put your openssl.cnf in one of these folders. What bothers me is the fact, that the article has the topic "Note to Win32 Users". But i think, this is mentioned for Win64 as well (but not sure).
Nobbie
 
Posts: 13176
Joined: 09. March 2008 13:04

Re: Path to openssl.cnf

Postby musicmaster » 17. August 2023 06:13

Thank you for your reply.

One additional question: I tried the environment variable trick and I couldn't get it to work. When I checked on Stackoverflow I noticed that in newer posts people often say that they couldn't get it work too.

Does this still work? Or is there something in the newest versions of Windows and Xampp that makes that it no longer works?
musicmaster
 
Posts: 34
Joined: 07. July 2016 19:47
XAMPP version: latest
Operating System: Windows

Re: Path to openssl.cnf

Postby Nobbie » 17. August 2023 10:51

I dont know, i dont use Windows (and neither Prestashop).
Nobbie
 
Posts: 13176
Joined: 09. March 2008 13:04


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 178 guests