title: Incompatibility between javax.security.cert.X509Certificate and java.security.cert.X509Certificate
body: <p>I want to verify the X509 certificate presented by a client against a CRL to see if it has been revoked.
  I have successfully instanciated a <code>java.security.cert.X509CRL</code>, but I am having problems retrieving the certificate of the session:</p>
  
  <pre><code>try {
      SSLSocket s = (SSLSocket) serverSocket.accept();
      s.setSoTimeout(TIMEOUT_RW * 1000);
      s.startHandshake();
      SSLSession session = s.getSession();
      X509Certificate[] cert = session.getPeerCertificateChain();
      if (crl.isRevoked(cert[0])) {
          System.err.println("Attempted to stablish connection using revoked certificate");
      } else {
          ...
      }
  } catch (Exception ex) {
      System.err.println("Something went wrong");
  }
  </code></pre>
  
  <p>SSLSession belongs to the <code>javax.net.ssl</code>  package, and its method <code>getPeerCertificateChain()</code> returns a <code>javax.security.cert.X509Certificate[]</code>, which cannot be converted to the <code>java.security.cert.X509Certificate[]</code> that I need to feed the <code>java.security.cert.X509CRL</code>.
  How can it be done?</p>