소스 검색

Enable TLS1.2 in download_file

TLS 1.0 is broken and a lot of servers have disabled it. This sets
TLS 1.2 in powershell before calling download.
Gabriel Adrian Samfira 6 년 전
부모
커밋
b69a67cdc9
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      coriolis/wsman.py

+ 2 - 0
coriolis/wsman.py

@@ -95,6 +95,8 @@ class WSManConnection(object):
         # Nano Server does not have Invoke-WebRequest and additionally
         # this is also faster
         self.exec_ps_command(
+            "[Net.ServicePointManager]::SecurityProtocol = "
+            "[Net.SecurityProtocolType]::Tls12;"
             "if(!([System.Management.Automation.PSTypeName]'"
             "System.Net.Http.HttpClient').Type) {$assembly = "
             "[System.Reflection.Assembly]::LoadWithPartialName("