Interface CertificateRequestedCallback


  • public interface CertificateRequestedCallback
    Is called during handshake and hooked into openssl via SSL_CTX_set_client_cert_cb. IMPORTANT: Implementations of this interface should be static as it is stored as a global reference via JNI. This means if you use an inner / anonymous class to implement this and also depend on the finalizer of the class to free up the SSLContext the finalizer will never run as the object is never GC, due the hard reference to the enclosing class. This will most likely result in a memory leak.
    • Method Detail

      • requested

        CertificateRequestedCallback.KeyMaterial requested​(long ssl,
                                                           byte[] keyTypeBytes,
                                                           byte[][] asn1DerEncodedPrincipals)
        Called during cert selection.
        Parameters:
        ssl - the SSL instance
        keyTypeBytes - an array of the key types.
        asn1DerEncodedPrincipals - the principals
        Returns:
        material to use or null if non should be used. The ownership of all native memory goes over to tcnative at this point.