title: Could not establish trust relationship for the SSL/TLS secure channel with Invoke-Webrequest from PowerShell
body: <p>When I try to use Invoke-WebRequest on https ,I'm getting some weird error:    </p>
  
  <p><b>"Invoke-WebRequest : The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel."</b></p>
  
  <p>It's My Code:</p>
  
  <pre><code>   [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls
      $url = "https://X.X.X.X:4343/officescan/console/html/cgi/cgiChkMasterPwd.exe"
      $r = Invoke-WebRequest $url -SessionVariable office
  </code></pre>
  
  <p>Any advice for me ??  Thanks a lot. </p>