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

Open Avast
(click on the image to open in a new tab)

2. Select Protection tab

Select Protection tab.
(click on the image to open in a new tab)

3. Select Firewall tab

Select Firewall tab.
(click on the image to open in a new tab)

4. Select the Disable for 10 minutes option

Disable shields for 10 minutes.
(click on the image to open in a new tab)

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.

Firewall Settings button

(click on the image to open in a new tab)

(click on the image to open in a new tab)


Go to the “Application Rules” tab.

Application Rulles page.
(click on the image to open in a new tab)


Add PHP executable

Navigate to your PHP executable.

C:\xampp\php\php.exe

Select it, and Open with the down arrow.

Select dropdown.
(click on the image to open in a new tab)

Click the Add New Rule button.

Select Add New Rule button
(click on the image to open in a new tab)

Configure Rule

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

Configuration Dialog
(click on the image to open in a new tab)

  • 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 creating two different rules, one private and one public.
(click on the image to open in a new tab)

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

Save your changes.

Allow both Private and Public network types.
(click on the image to open in a new tab)

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