title: Correct way of implementing checkServerTrusted for X509TrustManager
body: <p>What is a recommended way how to implement <code>checkServerTrusted</code> method for <code>X509TrustManager</code>? I need to use reimplement that for ssl pinning, but I can see just this implementation all the time:</p>
  
  <pre><code>public void checkServerTrusted(X509Certificate[] certificates, String authType)
      throws CertificateException {
      if ((certificates != null) &amp;&amp; (certificates.length == 1)) {
          certificates[0].checkValidity();
      } else {
          standardTrustManager.checkServerTrusted(certificates, authType);
      }
  }
  </code></pre>
  
  <p>taken from this <a href="https://stackoverflow.com/a/35571883/6270838" title="response">response</a>. However it seems to be wrong in my opinion. 
  It only checks whether certificate is valid (not expired), but nothing else.</p>
  
  <p>Is there any implementation you could recommend me, please?</p>