0

I am using flutter_inappwebview to load https URL in flutter. I am passing accessToken and JWT token with the URL which is length around 2300 characters. Without token's the URL is opening fine. But for complete URL it is giving SSL error. Unfortunately I can not share URL (Restrictions). My question is for URL is there any limit length for URL or am I missing something. Any help would be appreciated.

 return InAppWebView(
  initialUrlRequest: URLRequest(url: Uri.parse(deCodedURL)),

  onReceivedServerTrustAuthRequest: (controller, challenge) async {
    return ServerTrustAuthResponse(action: ServerTrustAuthResponseAction.PROCEED);
  },
);



[ERROR:ssl_client_socket_impl.cc(959)] handshake failed; returned -1, SSL error code 1, net_error -202

enter image description here

Kumar
  • 864
  • 1
  • 22
  • 46
  • in the browser, try to visit the exact same URL generated by the flutter code. If the same response or error shows up then the problem is with your website or your URL. – xamantra Dec 11 '22 at 05:43
  • Take a look at: https://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers. – user18309290 Dec 14 '22 at 17:54
  • try to add this in your manifest & try again https://developer.android.com/training/articles/security-config , but first try to open the url in web browser first. – Taqi Tahmid Tanzil Dec 15 '22 at 10:06

1 Answers1

2

You can bypass the SSL errors by configuring ServerTrustAuthResponseAction.PROCEED on onReceivedServerTrustAuthRequest similar to the snippet that you've shared.

I've tried the snippet you've shared on flutter_inappwebview: ^5.1.0 and it works without issues. It's likely that the error comes from something else. You can also try testing your InAppWebView implementation.

   InAppWebView(initialUrlRequest: URLRequest(url: Uri.parse(deCodedURL) ), 
     initialOptions: InAppWebViewWidgetOptions(
           inAppWebViewOptions: InAppWebViewOptions(
             debuggingEnabled: true,
          ),   ),   onReceivedServerTrustAuthRequest: (controller,challenge) 
     async {
         return ServerTrustAuthResponse(action: 
     ServerTrustAuthResponseAction.PROCEED); 
     },
    ),
Parthis
  • 359
  • 1
  • 10