Windows – enforce a cipher suite with powershell

powershellsslwindows

Can I enforce a cipher suite to be used when connecting to a TLS web site via a script.

For monitoring and trouble shooting purposes, my goal is to create a powershell script that checks if a remote server is able to use a specific cypher. I'm using the command Invoke-WebRequest now to connect to the websiste, but as far as I can see, there is no option to enforce a cipher.

Google was not friendly to me either.

Thanks for helping out.

PS: Powershell is prefered, but command line or vbscript is also fine.

Best Answer

You kind of can.

When looking at this page, you can set your own Cipher with the highest priority to use:

PS C:\>Enable-TlsCipherSuite -Name "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" -Position 0