AuthenticateWithApp throwns NullReferenceException

2019-03-04 17:04发布

Since today, we are facing a NullReferenceException when calling the AuthenticateWithApp-function in the .NET-Podio-Client (Newest Version 1.5.8).

I couldn't see an update of the Podio-API or any downtime in the status-website. I guess it must be a problem inside the Podio API.

Anybody with the same problem?

Regards Thorsten

标签: c# .net podio
3条回答
Bombasti
2楼-- · 2019-03-04 17:52

Stumbled upon that one too, today. Requests in postman worked Podio .NET library failed. It's caused by an API update by Podio, like @Sara said. Seems my system (and yours too) still defaults to Tls 1.0

Add this at beginning of Main(). This will force at least Tls 1.1.

System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11;

Alternatively you could also set the default like described here:

https://docs.microsoft.com/en-us/dotnet/framework/network-programming/tls

查看更多
做自己的国王
3楼-- · 2019-03-04 18:05

I could fix this issue today. The hint on the protocol from @derpirscher was helpful. Because we use .Net 4.0, i had to play around a little bit. But then i came up with this line:

ServicePointManager.SecurityProtocol = (SecurityProtocolType)768 | (SecurityProtocolType)3072;

I inserted this line in the Page_Load-Method of my Default.aspx-Page.

Now the calls to Podio-API are working correctly again. Thanks for help!

Regards Tony

查看更多
我命由我不由天
4楼-- · 2019-03-04 18:07

We have the same issue, we fixed this by modified the library. Most of our project which uses Podio Sync library. Podio Sync library belongs to Dotnet framework 4.0, so we added a line of code to set default security protocol.

ServicePointManager.SecurityProtocol = (SecurityProtocolType)768 | (SecurityProtocolType)3072;

The changes are done in Podio.cs file line 76

private T Request<T>(RequestMethod requestMethod, string url, dynamic requestData, dynamic options = null)
            where T : new()
        {
            Dictionary<string, string> requestHeaders = new Dictionary<string, string>();

changed to

 private T Request<T>(RequestMethod requestMethod, string url, dynamic requestData, dynamic options = null)
            where T : new()
        {
            ServicePointManager.SecurityProtocol = (SecurityProtocolType)768 | (SecurityProtocolType)3072;

            Dictionary<string, string> requestHeaders = new Dictionary<string, string>();

Hope this will help..


The solution for the SecurityProtocol issue can be found C# HttpWebRequest The underlying connection was closed: An unexpected error occurred on a send

查看更多
登录 后发表回答