I have a site certificate ('tls_connection_cert') for TSL connection and a private certificate ('private_cert.p12') for authentication. Whenever I want to make connection in dart I get an error SSLV3_ALERT_HANDSHAKE_FAILURE(tls_record.cc:586) with no extra information. Dart code:

SecurityContext context = new SecurityContext(withTrustedRoots: true)
  ..setTrustedCertificates('tls_connection_cert')
  ..usePrivateKey('private_cert.p12', password: 'password');

  await SecureSocket.connect(
      "service_host", 9002, context: context, onBadCertificate: _onSelfSignedCertificate).then((socket) {
    print('Connected to: '
        '${socket.remoteAddress.address}:${socket.remotePort}');
    socket.destroy();
  });

I already uses his service with a JAVA code which work perfectly, with no errors. The service in question is already used by the java code for 3 years now. Java code:

    KeyManager[] privateCert; // private_cert.p12
TrustManager[] publicCert; // tls_connection_cert
SSLContext ssl = SSLContext.getInstance("TLS");
ssl.init(privateCert.getKeyManagers(), publicCert.getTrustManagers(), null);
SSLSocket socket = (SSLSocket)ssl.getSocketFactory().createSocket("service_host", 9002);
socket.startHandshake();
socket.close();

Online service only allow TLSv1.2. Project is a Flutter project build in Android Studio on Windows 10 machine. How can I found what’s wrong with dart code?