Q: Flutter download file from laravel : HandshakeException: Handshake error in client I made a flutter program to download pdf files from laravel. I get an error when I press the download button.
Exception has occurred.
HandshakeException (HandshakeException: Handshake error in client (OS Error: 
    CERTIFICATE_VERIFY_FAILED: unable to get local issuer certificate(handshake.cc:354)))

Here is my download function :
Future<File> _downloadFile() async{
    final res = await Network().download("/letter/download/${surat.id_surat}");
    var bytes = await consolidateHttpClientResponseBytes(res);
    String dir = (await getApplicationDocumentsDirectory()).path;
    File file = new File('$dir/Surat_${surat.id_surat}');
    await file.writeAsBytes(bytes);
    return file;
  }

And this is the function of Network()
download(apiUrl) async{
    var fullUrl = "https://sub.domain.id/api" + apiUrl;
    await _getToken();
    return await http.get(
      fullUrl,
      headers: _setHeaders()
    );
  }

And this is the function from my Laravel to download the pdf file
public function download($id_surat){
        $fileName = $this->saveToPDF($id_surat);
        $file = public_path()."/surat/".$fileName;
        $headers = array('Content-Type: application/pdf',);
        return Response::download($file, $fileName, $headers);
    }

