jamiewest / signalr_core

ASP.NET Core SignalR Dart Client
https://pub.dev/packages/signalr_core
MIT License
90 stars 62 forks source link

Adding a custom header (CERTIFICATE_VERIFY_FAILED) #52

Closed pavane90 closed 3 years ago

pavane90 commented 3 years ago

I added a header referring to this article. However, a CERTIFICATE_VERIFY_FAILED error occurs.

E/flutter (11646): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: HandshakeException: Handshake error in client (OS Error: 
E/flutter (11646):  CERTIFICATE_VERIFY_FAILED: self signed certificate(handshake.cc:354))

An error occurs. I have referred to this article but it has not been resolved. Am I doing something wrong? I'd appreciate it if you could tell me how.

pavane90 commented 3 years ago

I solved this problem by myself. I was using this plug-in in foreground service, and the foreground operation was performed in an independent area, so I needed to add HttpOverrides.global = new MyHttpOverrides(); within the foreground function.