title: Download XML via HTTPS
body: <p>I'm trying to download XML file (Jenkins config.xml history file) from Jenkins HTTPS server. I searched here and elsewhere but still cannot find the way to get it working.</p>
  
  <pre><code>$url = "https://&lt;server-path&gt;/configOutput?type=xml&amp;timestamp=2018-02-23_13-09-02"
  
  $file = "d:\file.xml"
  [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Ssl3
  $wc = New-Object System.Net.WebClient
  $wc.Credentials = Get-Credential
  $wc.DownloadFile($url, $file)
  </code></pre>
  
  <p>After supplying credentials to prompt I'm getting this error:</p>
  
  <pre>
  Exception calling "DownloadFile" with "2" argument(s): "The underlying connection
  was closed: An unexpected error occurred on a receive."
  At D:\ps\jenkins-config\get_xml.ps1:7 char:1
  + $wc.DownloadFile($url,$file)
  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
      + FullyQualifiedErrorId : WebException
  </pre>