question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Configuring FFImageLoading's HttpClient throws a null reference exception

See original GitHub issue

I just updated from 2.7.2 to 3.1.0 and noticed the following configuration throws a null reference exception on Android.

Add this to MainActivity:

var configuration = new Configuration
{
	FadeAnimationEnabled = false,
	HttpClient = new System.Net.Http.HttpClient(new NativeMessageHandler())
};

I’m using FFImageLoading 2.4.11.982 and XF 4.

Adding @daniel-luberda in case this issue belongs to his code.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
Pinoxcommented, Jun 7, 2019

@alexrainman ,

Please consider an escape hatch in ModernHttpClient for guys that would like a less aggressive approach to security. Certificate pinning sounds good in theory but has significant inherent risks. When pinning a public key chain , we are assuming that the certificate authority, it’s intermediate certificates and your leaf certificate do not change.

So if you are not careful in your execution of renewing your certificate or if your certificate provider suddenly change their certificate then you are stuck as your public keys will change in such instances. Also, if your keys get compromised or if god forbid you lose them then you are forced to change your public key, so now you have to think about backup keys otherwise your users won’t be able to access your site.

In my opinion going offline is a much more severe threat than getting exposed to a sophisticated man-in-the-middle attack.

Google initiated certificate pinning and eventually abandoned it because of the lack of an build-in recovery mechanism. I know you stated version 2.7.2 is good but then many users will be stuck if something “new” breaks it.

1reaction
alexrainmancommented, Jun 11, 2019

Yes. I removed 3.x iterations as i am not planning to update this for a while.

Good to know it works as expected.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Why do I get a NullReferenceException when creating ...
1 Answer. You shouldn't be creating that many instances of HttpClient . This is an object that allows multiple connections at the same...
Read more >
Object Reference Not Set to an Instance of an Object
This exception is thrown when you try to access a member—for instance, a method or a property—on a variable that currently holds a...
Read more >
System.NullReferenceException: Object reference not set ...
Hi, I am trying the below code but it keeps throwing error when I use it on my app. Although I am not...
Read more >
Null Reference Exceptions
Null Reference Exceptions. A NullReferenceException happens when you try to access a reference variable that isn't referencing any object.
Read more >
What is NullReferenceException in C#? - Code Maze
In C#, a NullReferenceException occurs when we try to access a variable whose value has not been set or has been set to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found