How to fix 'System.Net.ServicePointManager' error when I open Powershell?

Matheus D. Santos 5 Reputation points
2023-03-25T21:45:54.1866667+00:00

I have tried everything that I could imagine. Things like, sfc /scannow, DISM, CHKDSK, Restore my Windows twice, changing the machine.conf to default and so long, any of these worked. So I want really to know if I can fix this problem with something that won't make me lose all my data or restore my PC to '0'.

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,032 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ayomide Oluwaga 941 Reputation points
    2023-03-25T23:26:36.72+00:00

    Hello Matheus,

    The 'System.Net.ServicePointManager' error in PowerShell usually occurs when there is a problem with the security protocol used by the .NET Framework.

    I can see how concerning this issue is to you and I have to say, i need more info:

    (i) does this happen randomly?

    (ii) Can I have the full exception trace, the full stack trace of the report?

    In the instance that you wish to try popular fixes that worked in the past while I make my findings, Here are some steps you can follow to fix this error:

    1. Open PowerShell as an administrator. Right-click on the PowerShell icon and select "Run as administrator" from the context menu.
    2. Type the following command in the PowerShell window and press Enter: [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 This command sets the security protocol used by the .NET Framework to TLS 1.2, which is the recommended protocol.
    3. If the error persists, try disabling the SSL/TLS protocol version 3.0 in the registry. To do this, follow these steps: a. Press the Windows key + R to open the Run dialog box. b. Type "regedit" and press Enter to open the Registry Editor. c. Navigate to the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Client d. Right-click on the Client subkey and select New > DWORD (32-bit) Value. e. Name the new value "Enabled" and set its value to 0. f. Restart your computer and try opening PowerShell again.

    If the error still persists, you may want to try repairing or reinstalling the .NET Framework on your computer.

    Since you have already tried the standard troubleshooting steps such as sfc /scannow, DISM, CHKDSK, and restoring your Windows twice and the issue persists, there are a few other things you can try before considering restoring your PC to '0':

    1. Reset Winsock: Open an elevated Command Prompt or PowerShell window and type the following command: netsh winsock reset Then, restart your computer and see if the issue has been resolved.
    2. Check for any third-party applications that may be interfering with PowerShell: Some antivirus software or other security applications may block PowerShell or interfere with its functioning. You can try disabling any third-party antivirus or security applications temporarily and see if the issue is resolved.
    3. Repair or reinstall PowerShell: If the issue persists, you can try repairing or reinstalling PowerShell. To do this, open an elevated PowerShell window and type the following command: Get-AppxPackage Microsoft.WindowsPowerShell* | Remove-AppxPackage Then, restart your computer and open PowerShell again. PowerShell should be reinstalled automatically.

    If none of these steps work, restoring your PC to '0' may be the only option left to fix the issue. However, before doing so, it is recommended to back up your important data to prevent any loss.

    Please let me know if this works for you.

    -Ayomide Oluwaga

    0 comments No comments