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.
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
- Press Win + R, type “ncpa.cpl“, and press Enter to open the Network Connections window.
- Right-click your active network connection and select Properties.
- In the Properties window, go to the Sharing tab and uncheck Allow other network users to connect through this computer’s Internet connection.
- Restart your computer and check if the error message is resolved.
1.2 Disable the Internet Connection Sharing Service
- Press Win + R, type “services.msc“, and press Enter to open the Services screen.
- Find the Internet Connection Sharing (ICS) service in the list and double-click on it.
- In the Internet Connection Sharing (ICS) window, under the General tab, set the Startup type to Disabled.
- 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.
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.
- Press Win + R, type “firewall.cpl“, and press Enter to open Windows Defender Firewall.
- Click on Allow an app or feature through Windows Defender Firewall.
- Click on the Change settings button.
- Find the app causing the error and ensure the Private and Public checkboxes are enabled.
Note: If the program isn’t listed, click Allow another app and find it manually using Browse.
- 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.
- Press Win + R, type “cmd“, and press Ctrl + Shift + Enter to open an elevated Command Prompt.
- Type
iisreset
and press Enter to restart the Internet Information Services.
- Wait for the services to restart, then try the action that was causing the error to check if the issue is resolved.
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.
- Press Win + R, type “rstrui“, and press Enter to open the System Restore wizard.
- Choose Show more restore points, select an earlier restore point, and click Next.
- 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.