Flutter http request to proxied rest Api - flutter

I put proxy on my Rest API in cloudflare.
Then whenever I try to make an http request, I get this error:
I/flutter (30668): HandshakeException: Handshake error in client (OS Error:
I/flutter (30668): SSLV3_ALERT_HANDSHAKE_FAILURE(tls_record.cc:594)
I/flutter (30668): HANDSHAKE_FAILURE_ON_CLIENT_HELLO(handshake.cc:644))
When I remove it, all request pass. But I need the proxy.
How do I handle this, please?

Related

Flutter https exception CERTIFICATE_VERIFY_FAILED: invalid or inconsistent certificate extension(handshake.cc:359))

I'm getting this error in a flutter app when making https calls with any of the dart:io, http, and dio package clients to a development server that has a self-signed certificate:
I/flutter ( 5545): HandshakeException: Handshake error in client (OS Error:
I/flutter ( 5545): CERTIFICATE_VERIFY_FAILED: invalid or inconsistent certificate extension(handshake.cc:359))
I've tried the suggestions in this post Flutter https with self signed certificate but both setting the badCertificateCallback on the client and using the HttpOverrides.global is not helping, in my case the callback is never hit/called. Any suggestions on what to try next?

Flutter - what causes XMLHttpRequest error

I would like to know if the 'XMLHttpRequest Error' thrown by http package is always due to missing CORS policy header?
The expection thrown in this instance is of Type ClientException - the only things that I can read is the message (XMLHttpRequest Error) and uri. So how would I know it is because of the above.
I get intermittent(and infrequent) errors in the logs, and the CORS policy header is correctly set on the server.
I want to rule out any other causes of XMLHttpRequest Error. Any ideas?

how to solve flutter dio connection timeout error

I/flutter (16260): DioError [DioErrorType.DEFAULT]: HttpException: Connection closed while receiving data, uri="URL".
I got this error while I post a req to the PHP backend which generate a file link .and send back the link as the response it takes about 5 seconds and more in postman. is there is any way to solve this problem with dio package or some other

Darts web socket connection problem with ssl

I want to use a web socket on Flutter.
I can easily connect to non-SSL API. But when connecting to an API with SSL get the following error.
WebSocketChannelException: WebSocketChannelException:
HandshakeException: Handshake error in client (OS Error:
WRONG_VERSION_NUMBER(tls_record.cc:242))
I tried using SecureSocket, but it doesn't allow adding parameters in SecureSocket.

HTTP status code for failed serialization

I have a GET /v2/developer/jhUxad8 endpoint which get developer from database and serialize it to json.
What http status code should I return when serialization fail?
https://www.codetinkerer.com/2015/12/04/choosing-an-http-status-code.html
What http status code should I return when serialization fail?
If I'm understanding you correctly, the server understands the request, and is trying to fulfill it, but because of a data problem is unable to do so.
500 Internal Server Error
The 500 (Internal Server Error) status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.