Handshake error in client (OS Error: TLSV1_ALERT_PROTOCOL_VERSION(tls_record.cc:586) in flutter app when trying to do a post/get request

2,030

I went through the same problem. The problem was with the server-side ssl certificate. I changed the request from https to http.

Share:
2,030
Govind
Author by

Govind

Updated on December 13, 2022

Comments

  • Govind
    Govind over 1 year

    I have Node.js rest APIs, which I am using in my flutter app to do requests accordingly, but when I tried to do the same I am getting an exception that is:

    Exception has occurred.
    HandshakeException (HandshakeException: Handshake error in client (OS Error: TLSV1_ALERT_PROTOCOL_VERSION(tls_record.cc:586)))
    

    I am doing the request with the http client like:

    import 'package:http/http.dart' as http;
    const _baseUrl = https://domain.in/api/
    
    http.Response response = await http.post(
          _baseUrl + 'user/login',
          body: json.encode(_authData),
          headers: {'Content-Type': 'application/json'},
        ).catchError((onError){
          print(onError);
        });
    

    It was working with http but it is not working with https.