OpenSSL Path

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

OpenSSL Path

Postby bma1 » 06. July 2015 19:51

Hello All,

I have XAMPP 5.6.8 installed on Windows 2008 R2 server. I have updated the PHP that came with the 5.6.8 release to Apache/2.4.12 (Win32) OpenSSL/1.0.1m from version l. I have enabled OpenSSL in the php.ini file by uncommenting extension=php_openssl.dll.
After restarting Apache, going to phpinfo() page shows the OpenSSL module loaded:
openssl
OpenSSL support enabled
OpenSSL Library Version OpenSSL 1.0.1m 19 Mar 2015
OpenSSL Header Version OpenSSL 1.0.1m 19 Mar 2015
In Apache>conf>extra>httpd-xampp.conf I have updated the variable to:
SetEnv OPENSSL_CONF "P:/xampp/apache/conf/openssl.cnf" from SetEnv OPENSSL_CONF "P:/xampp/apache/bin/openssl.cnf"

The problem I have is every time i open openssl.exe in the Apache bin folder, I get the message WARNING: can't open config file: c:/openssl-1.0.1m-win32/ssl/openssl.cnf. I have searched for an answer to this and have not had any luck so far. Going to the openssl.exe in the command prompt as an admin and putting the command there actually got me farther than the error in genrsa messages I was getting before in Apache>bin>openssl.exe itself:
OpenSSL> genrsa -out server.key 2048
Loading 'screen' into random state - done
Generating RSA private key, 2048 bit long modulus
.+++
Putting in the request for a csr gets a similar message to the opening warning:
OpenSSL> req -new -key server.key -out request.csr
Unable to load config info from c:/openssl-1.0.1m-win32/ssl/openssl.cnf
error in req

How do we resolve that c:/openssl-1.0.1m-win32/ssl/openssl.cnf message? Some search results say to set the environment path variable, but there is no openssl folder in that directory. If the message cannot be resolved, how do I generate a cert request?

Thanks!
bma1
 
Posts: 9
Joined: 06. July 2015 19:12
Operating System: Windows 2008 R2

Re: OpenSSL Path

Postby bma1 » 07. July 2015 18:43

So, I guess this isn't an easy fix. As a workaround I have installed a server certificate, root CA certificate, publishing CA certificate, and server key into the respective folders in Apache>conf and modified httpd-ssl.conf. SSL works perfectly fine now. This thread can be locked unless there is a solution for the original problem.

Thanks!
bma1
 
Posts: 9
Joined: 06. July 2015 19:12
Operating System: Windows 2008 R2

Re: OpenSSL Path

Postby gsmith » 08. July 2015 22:41

It's an easy fix, your understanding is wrong.
SetEnv in Apache has nothing to do when you open a command prompt console. SetEnv is internal to Apache and any processes it spawns only.

Before calling openssl, use the "Set" command at the command prompt.

SET OPENSSL_CONF "C:/xampp/apache/conf/openssl.cnf"

then you can start making your certificate.
gsmith
 
Posts: 278
Joined: 29. November 2013 18:04
Location: San Diego
XAMPP version: 0.0.0
Operating System: Win 10/2012R VS 14,15,16

Re: OpenSSL Path

Postby bma1 » 09. July 2015 15:43

Hmmm will try that, thanks!
bma1
 
Posts: 9
Joined: 06. July 2015 19:12
Operating System: Windows 2008 R2

Re: OpenSSL Path

Postby riopiedra » 13. March 2021 11:57

Small correction for the recommended command line, before running openssl.exe:

SET OPENSSL_CONF=C:/xampp/apache/conf/openssl.cnf
riopiedra
 
Posts: 2
Joined: 13. March 2021 11:52
XAMPP version: 3.2.4
Operating System: Windows 10


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 208 guests