1

I'm not sure why this API I'm requesting is throwing this error for only dart. For some reason dart throws this error when I attempt to make a POST request:

Unhandled Exception: NO_RENEGOTIATION(ssl_lib.cc:1725) error 268435638 #0 IOClient.send (package:http/src/io_client.dart:90:7)

I tried the same endpoint in both Python, Java and even manually and it worked fine. It worked fine with a local server, and then when I went to push to production I encountered this problem.

  • You could *try* turning on TLS renegotiation ( https://api.flutter.dev/flutter/dart-io/SecurityContext/allowLegacyUnsafeRenegotiation.html ) but I think that'd be part of an investigation, not a solution - there's probably a reason why the industry has decided it's unsafe. A similar discussion with Rust might add more info. https://stackoverflow.com/questions/57420833/tls-no-renegotiation-error-on-http-request – GregHNZ Nov 14 '22 at 21:29

1 Answers1

0

add this in main

void main() {
 final context = SecurityContext.defaultContext;
 context.allowLegacyUnsafeRenegotiation = true;
 final httpClient = HttpClient(context: context);
 runApp(const MyApp());
}
ALNAJJAR
  • 292
  • 3
  • 11