0

As I read over internet I found out that there is a bug in Flutter with validating WildCard (example : *.mydomain.com) certificates and I didn't find any example or suggestions how to do that. The thing that I want to achieve are : Validating the certificate by it's name and to check if it's expired or not. Any good suggestions/examples are welcomed, because that's my first try with SSL and I'm not really familiar with it.

I am making api call using dio and and certificate is from comodo it is a wildcard ssl and it is not expired (its valid ssl) url work in ios but not in android apk

Thanks in advance!

Amit
  • 468
  • 5
  • 16
  • What makes you think that wildcard certificates don't work. Please update the question with some actual code that's not working. – Richard Heap Sep 20 '19 at 17:00
  • i m simply calling api using dio but it is giving hand shake error in api call when i use wildcard cirtificate url. *.mydomain.com is my url in certifacate and my api is on api.mydomain.com/vi/login DioError [DioErrorType.DEFAULT]: HandshakeException: Handshake error in client (OS Error: CERTIFICATE_VERIFY_FAILED: Hostname mismatch(handshake.cc:352)) – Amit Sep 25 '19 at 10:23
  • If you could use `package:http` instead, here's how to validate your own certificate CN: https://stackoverflow.com/questions/51323603/how-to-do-ssl-pinning-via-self-generated-signed-certificates-in-flutter/51328065#51328065 I'm not sure if you can use the same trick with `dio` - maybe take a look at the dio source code to see. – Richard Heap Sep 25 '19 at 16:44
  • the problem is not solving same url work on ios but not on svg_flutter lib also and not with dio – Amit Oct 16 '19 at 09:25
  • @RichardHeap the answer you provide is for self sign certificate – Amit Oct 16 '19 at 09:28
  • it would work just as well with any certificate. In your question you say: `Validating the certificate by it's name and to check if it's expired or not.` The linked question shows how look at exactly those two things: the `subject` and the `endValidity`. – Richard Heap Oct 16 '19 at 11:07

0 Answers0