cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Share your feedback on the Document Scanning Experience in the Dropbox App right here.

Discuss Dropbox Developer & API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Could not create ssl tls secure channel .net library api

Could not create ssl tls secure channel .net library api

adelhoss
Explorer | Level 3

Hello my friends
I write simple winform application for download files from my account dropbox .
After few hour exception is raised :
Could not create ssl/tls secure channel .
I test on vps server in germany

5 Replies 5

Greg-DB
Dropbox Staff

The Dropbox API servers are being served with valid SSL/TLS configurations, and I'm not aware of any current service disruptions that may cause this. It sounds like there may an issue with your network connection or system. Here are some threads that may be helpful:

adelhoss
Explorer | Level 3
After 12 hour activity show this exception ....
Problem in your library ....

Greg-DB
Dropbox Staff

If there's an issue with the official Dropbox .NET SDK, we'll be happy to look into it, but we'll need some more information. Please reply with:

- the name and version number of the platform and SDK you are using
- the steps to reproduce the issue, including relevant code snippet(s)
- the full text of any error or unexpected output

SHommersom
New member | Level 2

I've encountered the same issue as you. I managed to fix it by adding the following lines of code

 


ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

 

before calling the dropbox functions, e.g. in the Main() function of the application.

warnerjonn
New member | Level 2

The error is generic and there are many reasons why the SSL/TLS negotiation may fail. ServicePointManager.SecurityProtocol property selects the version of the Secure Sockets Layer (SSL) or Transport Layer Security (TLS) protocol to use for new connections; existing c# socket connections aren't changed. Make sure the ServicePointManager settings are made before the HttpWebRequest is created, else it will not work. Also, you have to enable other security protocol versions to resolve this issue:

ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12
SecurityProtocolType.Tls
SecurityProtocolType.Tls11
SecurityProtocolType.Ssl3;

//createing HttpWebRequest after ServicePointManager settings
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://google.com/api/")

 

If you create HttpWebRequest before the ServicePointManager settings it will fail and shows the error message.

 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    warnerjonn New member | Level 2
  • User avatar
    SHommersom New member | Level 2
  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    adelhoss Explorer | Level 3
What do Dropbox user levels mean?