title: Flutter - How to get api response from a certification errored link
body: <p>I'm trying to get an api from <a href="http://www.mocky.io" rel="nofollow noreferrer">www.mocky.io</a>, the issue is, when the app starts I'm getting an error like</p>
  
  <p><code>E/flutter (  846): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: HandshakeException: Handshake error in client (OS Error: 
  E/flutter (  846):  CERTIFICATE_VERIFY_FAILED: unable to get local issuer certificate(handshake.cc:354))</code></p>
  
  <p><em>this is  how I'm getting the response.</em></p>
  
  <pre><code>  Future _fetchPost() async {
  http.Response response = await http.get(url);
  
  print(response.body);
  
  setState(() {
    var convertDatatoJson = json.decode(response.body);
    debugPrint(convertDatatoJson.toString());
    _data = convertDatatoJson['table_menu_list'];
  });}
  </code></pre>
  
  <p>How can I verify the certificate for this api link for GET method?</p>
  
  <p>I referred this issue, for POST method <a href="https://stackoverflow.com/a/54359013/11893608">https://stackoverflow.com/a/54359013/11893608</a>,</p>
  
  <p>any other suggestions would be helpful</p>