Documentation

How to fix localhost error – cURL error 35 (SSL connect error)

You might have been testing AG Worldline Hosted Checkout in your localhost as well and have been encountering the cURL error 35 (SSL connect error) upon your test checkout.

Technically, this error message denotes that there is an error somewhere in SSL/TLS handshake. In short, the cURL error code 35 denotes an SSL connection error. The error can be due to an outdated cURL package, connection errors, or else a version mismatch between the PHP cURL and SSL protocol of the end server.

Enabling CURL via the php.ini

The first step is to ensure that your cURL in your localhost is active. One of the best ways to do so is to follow the instructions below.

This is the main method on any windows install like WAMP, XAMPP, etc

1. Locate your PHP.ini file
(normally located in the bin folder of your apache install e.g.
2. Open the PHP.ini in notepad
3. Search or find the following: ‘;extension=php_curl.dll’
4. Uncomment this by removing the semi-colon ‘;’ before it
5. Save and Close PHP.ini
6. Restart Apache

Configuring a simulated SSL on your localhost

This solution will vary if your localhost setup allows such. For localhost set from PHP development environments like WAMP and XAMPP, this may work for you. Buckle up as the steps below are moderately technical.

For WAMP:
Step 1: Download and Install OpenSSL on the server.
OpenSSL is available in both 32 and 64 bit versions. You can download the OpenSSL software for windows from the link http://gnuwin32.sourceforge.net/packages/openssl.htm
Make sure you leave the installation to the default settings.

Step 2: Creation of SSL Private Key and Certificate
Once the software is installed, the next step is to create the private key and certificate.

  1. Open the Start Menu -> Right click on command prompt -> “Run as Administrator”
  2. Change the directory to the location where OpenSSL

cd C:\Program Files\openssl-win64/bin

  1. Creation of private key and setting up passphrase

opensslgenrsa -aes256 -out private.key 2048 #generating private key
opensslrsa -in private.key -out private.key #removing the pass phrase

  1. The next step is to create the certificate which involves answering a some questions. The common name should set as “localhost”

opensslreq -new -x509 -nodes -sha1 -key private.key -out certificate.crt -days 36500 #creating the certificate

Step 3: Copy the created SSL Key and certificate
The next step is to create a folder called “key” in the location C:\wamp64\bin\apache2.4.41\conf\. Copy C:\Program Files\openssl-win64\bin\certificate.crt and private.key to the newly created folder called key (C:\wamp64\bin\apache2.4.41\conf\key).

Step 4: Edit the httpd.conf file
The next step after copying of the files is to edit the httpd.confffile. Open the file C:\wamp64\bin\apache\apache2.4.41\conf\httpd.conf and un-comment (remove #) from the following 3 lines –
LoadModulessl_module modules/mod_ssl.so
Include conf/extra/httpd-ssl.conf
LoadModulesocache_shmcb_module modules/mod_socache_shmcb.so
The next step is to confirm that the following line is un-commented in the “php.ini” file located in “C:\wamp64\bin\php\php7.0.10\php.ini”
extension=php_openssl.dll

Step 5: Edit the httpd-ssl.conf file
The next step is to edit the httpd-ssl.conf file located in C:\wamp64\bin\apache\apache2.4.71\conf\extra\httpd-ssl.conf. The existing parameters should be changed to the following

VirtualHost *:443>
DocumentRoot “c:/wamp64/www”
ServerName localhost:443
ServerAdmin admin@example.com
ErrorLog “${SRVROOT}/logs/error.log”
TransferLog “${SRVROOT}/logs/access.log”
SSLCertificateFile “${SRVROOT}/conf/key/certificate.crt”
SSLCertificateKeyFile “${SRVROOT}/conf/key/private.key”
CustomLog “${SRVROOT}/logs/ssl_request.log”
</VirtualHost>

The DocumentRoot folder is the location where the website files are located. The ServerName can be set as “localhost” or the name set to access the website like “example.com”

Step 6: Restart the WAMP Server
The final step is to restart the WAMP server for the changes to take effect. A green WAMP icon indicates that everything is good. If the icon is orange, it means that there is a problem with the syntax in the configuration.

For XAMPP
1. Navigate to Apache directory in XAMPP. In regular install it’s in C:\xampp\apache.
2. Create a folder in that page. This is where you will store the cert. In this example, I will create “crt” folder. So we will have C:\xampp\apache\crt
3. Add these files(Double-check your directory first as most often, these files are already available and ready to be used):
cert.conf
make-cert.bat
4. Edit cert. Change {{DOMAIN}} text using the domain we want to use, in this case, just add localhost and save (take note that you will need to add your localhost’s domain name here).
Double click the make-cert.bat and input the domain site.test when prompted. And just do enter in other questions since we already set the default from cert.conf.

5. Install the cert in windows.After that, you will see site.test folder created. In that folder, we will have server.crt and server.key. This is our SSL certificate.
Double click on the server.crt to install it on Windows so Windows can trust it. Set the store location field as local machine.
8. Restart your browser and test it again.

If the error persists even after following these steps, please feel free to contact our support team and we’ll be glad to check what other factors might be affecting your localhost setup and help you with this.

Was this helpful?

Worldline Hosted Checkout

Don't already have the plugin? Get access now.

Still need help?

Our team are on hand to provide fast, helpful and professional support.

Support request