I have a Xamarin.Forms app which communicates with an SignalR hub. The communication uses my own SSL certificate, which however is untrusted. There is no problem with handling an untrusted certificated on Android and iOS, using the ICertificatePolicy
interface and implementing ServicePointManager.ServerCertificateValidationCallback
. However, I cannot find a reasonable alternative for Windows 8.1, Windows Phone 8.1 and Windows 10 Universal App.
Does there exist an alternative? It does not matter, if its platform-specific, I can use Xamarin's DependencyService
. However, it should trigger an event, passing the certificate, so I could ask the user, whether he accepts the particular certificate.
UPDATE
As I have just found out, the ICertificatePolicy method is not called at all, leaving only the ServicePointManager.ServerCertificateValidationCallback method relevant (for iOS and Android). Is there some alternative to this class in Windows Phone 8.1 and Windows 10 Universal App?
UPDATE 2
I have tried following this guide by including the self-signed certificate to Windows 10 app and writing the code provided in Windows Phone 8.1. Did not work.
I have then tried implementing this workaround. Even that did not work.
My last attempt was to create a trusted SSL certificate following this tutorial, but even after precisely following the steps I ended up with an untrusted certificate. And, of course, I was unable to connect both with Windows 10 and Windows Phone 8.1.
It seems the only remaining option is to use HttpBaseProtocolFilter
, as described in this answer, but I do not know how to implement it in SignalR client.
Does there exist any functional solution?