How to Fix “SSL operation failed with code 1” error caused by firewall. Easy explanation

We have talked about how an outdated or missing Certificate Authority (CA) bundle on our system can cause this error and what to do about it.

Sometimes, though, the problem is more simple.

After we have verified that it is not a certificate issue, we must look for other causes triggering the issue.

A likely candidate is a firewall in our system. https://www.kaspersky.com/resource-center/definitions/firewall

We must check Windows Defender or a third-party firewall installed in our system.

It is either the first or the latter.

In my case, it is Avast, but the process is more or less similar with Windows Defender or the other known firewalls like Norton, McAfee, etc.

Temporarily Disable Avast Firewall to Test

Just to confirm it’s an Avast issue:

1. Open Avast

Image showing how to open Avast.
Open Avast

2. Select Protection tab

Image showing how to select th Protection tab.
Select Protection tab.

3. Select Firewall tab

Image showing how to select the Firewall tab.
Select Firewall tab.

4. Select the Disable for 10 minutes option

Image showing the Disable shields dialog.
Disable shields for 10 minutes.

Try the PHP HTTPS request (like installing Composer).

If it works, then the firewall was the issue. Turn the firewall back on and proceed to create a permanent rule.

Step-by-Step: Allow PHP Through Avast Firewall

Add PHP to Avast’s Application Rules

First open Avast. Click on the Avast icon in the system tray or start it from the Start menu.

Then Go to Menu > Settings > Protection > Firewall.

Now click on Settings icon.

Image showing where the Firewall settings button resides.
Firewall Settings button

Image showing where is located the View Firewall Rules button.
View Firewall Rules


Go to the “Application Rules” tab.

Image showing the Application Rules page.
Application Rules page.


Add PHP executable

Navigate to your PHP executable.

C:\xampp\php\php.exe

Select it, and Open with the down arrow.

Image showing how to select drop-down.
Select drop-down.

Click the Add New Rule button.

Image showing how to select the Add New Rule button.
Select Add New Rule button

Configure Rule

A new dialog will open through which we can configure the new rule.

The configuration dialog.
Configuration Dialog

  • Set profile of the network type to be All (both Private and Public). If this is not possible create two different rules, one private and one public.
Example of two differen rules. One private and one public.
Example of creating two different rules, one private and one public.

  • Set all network types (Private & Public) to Allow.
  • Make sure Inbound and Outbound are both allowed.

Save your changes.

Example of editing rule.
Allow both Private and Public network types.

Although my blog doesn’t support comments, feel free to reply via email or X.