Skip to content
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

The underlying connection was closed: An unexpected error occurred on a receive #649

Open
HayS33d opened this issue Apr 6, 2017 · 2 comments

Comments

@HayS33d
Copy link

HayS33d commented Apr 6, 2017

When I attempt to upload a file to Rackspace I get an error returned from the API
"The underlying connection was closed: An unexpected error occurred on a receive"

The innerException is
The client and server cannot communicate, because they do not possess a common algorithm

Our servers are PCI compliant. I cannot figure what is needed to make this work.

public UploadToCloud(string username, string apiKey)
{
cloudIdentity = new CloudIdentity()
{
Username = username,
APIKey = apiKey
};
}

    public Boolean UploadFile(string fileName, String container)
    {
        FlushError();
        var cloudFilesProvider = new CloudFilesProvider(cloudIdentity);
        if (!File.Exists(fileName))
        {
            errorMessage = fileNotFoundError;
            return false;
        }
        try
        {
            //cloudFilesProvider.CreateContainer("phptest", region:"DFW");
            cloudFilesProvider.CreateObjectFromFile(container, fileName);//, "2017/"+ Path.GetFileName(fileName));
            
            return true;
        }
        catch( Exception e )
        {
            errorMessage = e.Message;
            errorStatus = true;
            return false;
        }
    }
@HayS33d
Copy link
Author

HayS33d commented Apr 6, 2017

Figured it out. Had to force use of .NET 4.6 so TLS 1.2 is used.

@azatabd
Copy link

azatabd commented Jul 13, 2022

Figured it out. Had to force use of .NET 4.6 so TLS 1.2 is used.

Can you please help with this? Still not clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants