Is it possible to enable TLS 1.2 as default in Powershell

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Fredrik Kacsmarck Fredrik Kacsmarck 2 months, 2 weeks ago.

  • Author
    Posts
  • #68230
    Profile photo of Fredrik Kacsmarck
    Fredrik Kacsmarck
    Participant

    Have searched and it seems that it should be possible to set the default values via various regkey's.
    But so far none of them have changed the output of:

    [Net.ServicePointManager]::SecurityProtocol
    

    So is there a way to include TLS12 as default and not just SSL3 and TLS?

    I know you can set this manually in a session.
    But I'm wondering if this can be set as a default setting.

  • #68301
    Profile photo of Mike Shepard
    Mike Shepard
    Participant

    Try this:

    [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12;

    It should work against subsequent Invoke-WebRequest calls.

  • #68304
    Profile photo of Fredrik Kacsmarck
    Fredrik Kacsmarck
    Participant

    Yes but not in the next session without adding it again or e.g. if you're e.g. using DSC.
    Via various pages they suggest that you can set the regkeys for schannel, the .netframework hive etc. but nothing seem to affect the defaults of PS.

You must be logged in to reply to this topic.