Skip to content

Support TLS > 1.0 #2174

Closed
Closed

Description

@maartenba

Description

We tried installing a NuGet package from a server that only supports TLS version 1.1 and up. It seems Paket expects TLS 1.0 to be available, looking at the verbose log we get.

Repro steps

Unfortunately we don't have a public server to repro, but we do have a log (see below).

All we did was a paket add nuget SamplePackage which we'd expect to "just work".

Expected behavior

Package is installed.

Actual behavior

Verbose log:

Paket version 3.36.1
found: C:\Users\maart\Downloads\paket.dependencies
Parsing C:\Users\maart\Downloads\paket.dependencies
Adding SamplePackage to C:\Users\maart\Downloads\paket.dependencies into group Main
Resolving packages for group Main:
  0 packages in resolution. 1 requirements left
  Trying to resolve SamplePackage  (from C:\Users\maart\Downloads\paket.dependencies)
  - fetching versions for SamplePackage
Error while retrieving 'https://***redacted***/api/v3/index.json': System.AggregateException: One or more errors occurred. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
   at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
   --- End of inner exception stack trace ---
   at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
   at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
   at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
   at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
   --- End of inner exception stack trace ---
   at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
   at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
   at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)<---

getAllVersionsAPI: System.Exception: Could not load resources from https://***redacted***/api/v3/index.json
   at Microsoft.FSharp.Core.Operators.FailWith[T](String message)
   at Paket.PackageSources.getNuGetV3Resource@99-1.Invoke(FSharpOption`1 _arg1)
   at Microsoft.FSharp.Control.AsyncBuilderImpl.args@835-1.Invoke(a a)
getAllVersionsFromNugetODataWithFilter from url 'https://***redacted***/api/v2/Packages?$filter=tolower(Id) eq 'SamplePackage''
getAllVersionsFromNugetODataFindById from url 'https://***redacted***/api/v2/FindPackagesById()?id='SamplePackage''
Error while retrieving 'https://***redacted***/api/v2/package-versions/SamplePackage?includePrerelease=true': System.AggregateException: One or more errors occurred. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
   at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
   --- End of inner exception stack trace ---
   at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
   at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
   at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
   at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
   --- End of inner exception stack trace ---
   at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
   at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
   at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)<---

getAllVersionsFromNugetODataFindById from url 'https://***redacted***/api/v2/FindPackagesById()?id='SamplePackage''
getAllVersionsFromNugetODataWithFilter from url 'https://***redacted***/api/v2/Packages?$filter=tolower(Id) eq 'SamplePackage''
Error while retrieving 'https://***redacted***/api/v2/package-versions/SamplePackage?includePrerelease=true': System.AggregateException: One or more errors occurred. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
   at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
   --- End of inner exception stack trace ---
   at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
   at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
   at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult)
   at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult)
   --- End of inner exception stack trace ---
   at System.Net.TlsStream.EndWrite(IAsyncResult asyncResult)
   at System.Net.ConnectStream.WriteHeadersCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
   at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)<---

Activity

  1. forki commented on Mar 6, 2017

    @forki
    Member
  2. maartenba commented on Mar 6, 2017

    @maartenba
    Author

    http://blogs.perficient.com/microsoft/2016/04/tsl-1-2-and-net-support/

    Looks like you may want to add something like:

                ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls
                    | SecurityProtocolType.Tls11
                    | SecurityProtocolType.Tls12
                    | SecurityProtocolType.Ssl3;
    
  3. forki commented on Mar 13, 2017

    @forki
    Member

    Can you please test if it's fixed? thanks

  4. maartenba commented on Mar 13, 2017

    @maartenba
    Author

    Works like a charm!

  5. forki commented on Mar 13, 2017

    @forki
    Member
  6. maartenba commented on Mar 14, 2017

    @maartenba
    Author

    Not sure, not a lot of info out there :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions