Fix: An Attempt Was Made to Access a Socket in a Way Forbidden by its Access Permissions

The “An attempt was made to access a socket in a way forbidden by its access permissions” error means a program is trying to use a network socket without the right permissions. This usually happens if another process is using the port or if security software, like firewalls or antivirus, is blocking access.

An attempt was made to access a socket in a way forbidden by its access permissions
An attempt was made to access a socket in a way forbidden by its access permissions

Other reasons might be admin restrictions or reserved port ranges.

In this article, we will discuss different ways to solve this error.

1. Disable Internet Connection Sharing

When multiple services or apps try to use the same network resource, conflicts can happen, causing the socket access error. Disabling Internet Connection Sharing ensures no other process is using or reserving the needed ports, allowing your app to access them correctly again.

1.1 Disable Internet Connection Sharing via Control Panel

  1. Press Win + R, type “ncpa.cpl“, and press Enter to open the Network Connections window.
    Open the Network Connection menu
    Open the Network Connection menu
  2. Right-click your active network connection and select Properties.
    Right-click on your network connection and choose Properties
    Right-click on your network connection and choose Properties
  3. In the Properties window, go to the Sharing tab and uncheck Allow other network users to connect through this computer’s Internet connection.
    Disabling Internet Connection sharing
    Disabling Internet Connection sharing
  4. Restart your computer and check if the error message is resolved.

1.2 Disable the Internet Connection Sharing Service

  1. Press Win + R, type “services.msc“, and press Enter to open the Services screen.
    Type in services.msc
  2. Find the Internet Connection Sharing (ICS) service in the list and double-click on it.
  3. In the Internet Connection Sharing (ICS) window, under the General tab, set the Startup type to Disabled.
    Setting the Startup type of the ICS to Manual
    Setting the Startup type of the ICS to Manual
  4. Restart your computer and check if the issue is resolved.

2. Uninstall any third-party Antivirus or Whitelisting the Connection

Sometimes, security software blocks safe connections by mistake. Removing third-party antivirus or allowing the application through a whitelist helps the software access the network without problems, preventing errors.

You can typically resolve this issue by whitelisting the blocked connection in your antivirus settings. Keep in mind that the steps to set up a whitelist rule will vary depending on your security solution.

In

You can check our detailed guide on how to uninstall antivirus here.

3. Add an Exclusion to the Windows Firewall

When Windows Firewall blocks a program, it can’t access the network resources it needs, leading to errors. Adding an exception for the program tells the firewall to trust it and allow its network activity, bypassing the restrictions causing the socket access problem.

  1. Press Win + R, type “firewall.cpl“, and press Enter to open Windows Defender Firewall.
    Run dialog: firewall.cpl
    Run dialog: firewall.cpl
  2. Click on Allow an app or feature through Windows Defender Firewall.
    Click on Allow an app or feature through Windows Defender Firewall
    Click on Allow an app or feature through Windows Defender Firewall
  3. Click on the Change settings button.
    Clicking on Change settings to allow security changes
    Click on Change settings to allow security changes
  4. Find the app causing the error and ensure the Private and Public checkboxes are enabled.
    Allowing the application on Private and Public networks
    Allowing the application on Private and Public networks

    Note: If the program isn’t listed, click Allow another app and find it manually using Browse.

    Allowing another app that is not listed
    Allowing another application that is not listed
  5. After making changes, restart your computer to see if the “an attempt was made to access a socket in a way forbidden by its access permissions” error is resolved.

4. Restart the Internet Information Services (IIS)

Restarting the Internet Information Services (IIS) clears all active connections and fixes any port conflicts causing the error. This helps IIS start with the right settings, letting applications access the needed ports again.

  1. Press Win + R, type “cmd“, and press Ctrl + Shift + Enter to open an elevated Command Prompt.
    Run dialog: cmd, then press Ctrl + Shift + Enter
    Run dialog: cmd, then press Ctrl + Shift + Enter
  2. Type
    iisreset

    and press Enter to restart the Internet Information Services.

  3. Wait for the services to restart, then try the action that was causing the error to check if the issue is resolved.
    Restarting the Internet Information Services
    Restarting the Internet Information Services

    If the error “an attempt was made to access a socket in a way forbidden by its access permissions” persists, continue to the next method.

5. Perform a System Restore

Rolling back your system to an earlier state can fix problems caused by recent changes. System Restore brings back important system files and settings to a time before the error appeared, helping to solve conflicts from recent software or setting changes.

  1. Press Win + R, type “rstrui“, and press Enter to open the System Restore wizard.
    Run dialog: rstrui
    Run dialog: rstrui
  2. Choose Show more restore points, select an earlier restore point, and click Next.
    Select a system restore point and click Next
    Select a system restore point and click Next
  3. Click Finish to restart your computer and apply the restore point. Check if the issue is resolved after the reboot.

6. Disconnect from the VPN network

Sometimes, VPN connections use specific ports that can interfere with the application trying to access the same resources. Disconnecting from the VPN network can resolve this issue, allowing the needed ports to be used without problems.

ABOUT THE AUTHOR

Kevin Arrows


Kevin Arrows is a highly experienced and knowledgeable technology specialist with over a decade of industry experience. He holds a Microsoft Certified Technology Specialist (MCTS) certification and has a deep passion for staying up-to-date on the latest tech developments. Kevin has written extensively on a wide range of tech-related topics, showcasing his expertise and knowledge in areas such as software development, cybersecurity, and cloud computing. His contributions to the tech field have been widely recognized and respected by his peers, and he is highly regarded for his ability to explain complex technical concepts in a clear and concise manner.