New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support TLS > 1.0 #2174

Closed
maartenba opened this Issue Mar 6, 2017 · 6 comments

Comments

Projects
None yet
2 participants
@maartenba

maartenba commented Mar 6, 2017

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)<---
@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Mar 6, 2017

Member
Member

forki commented Mar 6, 2017

@maartenba

This comment has been minimized.

Show comment
Hide comment
@maartenba

maartenba Mar 6, 2017

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;

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;

@forki forki closed this in 3ae9dce Mar 13, 2017

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Mar 13, 2017

Member

Can you please test if it's fixed? thanks

Member

forki commented Mar 13, 2017

Can you please test if it's fixed? thanks

@maartenba

This comment has been minimized.

Show comment
Hide comment
@maartenba

maartenba Mar 13, 2017

Works like a charm!

Works like a charm!

@forki

This comment has been minimized.

Show comment
Hide comment
@forki

forki Mar 13, 2017

Member
Member

forki commented Mar 13, 2017

@maartenba

This comment has been minimized.

Show comment
Hide comment
@maartenba

maartenba Mar 14, 2017

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

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