| Modifier and Type | Class and Description |
|---|---|
| public static interface | SSLContext.
Interface implemented by components that will receive the call back to select an OpenSSL SSLContext based on the host name requested by the client. |
| Modifier and Type | Field and Description |
|---|---|
| public static final byte[] | |
| private static final Map | sniCallBacks
A map of default SSL Contexts to SNICallBack instances (in Tomcat these are instances of AprEndpoint) that will be used to determine the SSL Context to use bases on the SNI host name. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static native boolean | Returns: true if success, false otherwise.Server or Client context to use. ctx, byte[] Byte array with the certificate in DER encoding. cert)Add a certificate to the certificate chain. |
| public static native boolean | Returns: true if success, false otherwise.Server or Client context to use. ctx, byte[] Byte array with the certificate in DER encoding. cert)Add a CA certificate we accept as issuer for peer certs |
| public static native void | clearOptions(long
Server or Client context to use. ctx, int See SSL.SSL_OP_* for option flags. options)Clears OpenSSL Options. |
| public static native int | Returns: APR Status code.Server or Client context to free. ctx)Free the resources used by the Context |
| public static native String[] | Returns: ciphersServer or Client context to use. ctx)Returns all cipher suites that are enabled for negotiation in an SSL handshake. |
| public static native int | Returns: options See SSL.SSL_OP_* for option flags.Server or Client context to use. ctx)Get OpenSSL Option. |
| public static native long | Returns: the value setServer or Client context to use. ctx)Get the mode of the current used internal session cache. |
| public static native long | Returns: the sizeServer or Client context to use. ctx)Get the size of the internal session cache. |
| public static native long | Returns: the timeoutServer or Client context to use. ctx)Get the timeout for the internal session cache in seconds. |
| public static native long | Returns: The Java representation of a pointer to the newly created SSL ContextThe pool to use. pool, int The SSL protocol to use. It can be any combination of
the following:
protocol, int
SSL mode to use
mode)SSL_MODE_CLIENT SSL_MODE_SERVER SSL_MODE_COMBINED Create a new SSL context. |
| public static native long | |
| public static native long | |
| public static native long | |
| public static native long | |
| public static native long | |
| public static native long | |
| public static native long | |
| public static native long | |
| public static native long | |
| public static native long | |
| public static native long | |
| public static native long | |
| public static native void | setAlpnProtos(long
Server context to use. ctx, String[] protocols in priority order alpnProtos, int selectorFailureBehavior)Set application layer protocol for application layer protocol negotiation extension |
| public static native boolean | Returns: true if the operation was successfulServer or Client context to use. ctx, String File of concatenated PEM-encoded CA Certificates for
Client Auth. file, String Directory of PEM-encoded CA Certificates for Client Auth. path)Set File and Directory of concatenated PEM-encoded CA Certificates for Client Auth This directive sets the all-in-one file where you can assemble the Certificates of Certification Authorities (CA) whose clients you deal with. |
| public static native boolean | Returns: true if the operation was successfulServer or Client context to use. ctx, String File of concatenated PEM-encoded CA CRLs for Client Auth. file, String Directory of PEM-encoded CA Certificates for Client Auth. path)Set File of concatenated PEM-encoded CA CRLs or directory of PEM-encoded CA Certificates for Client Auth This directive sets the all-in-one file where you can assemble the Certificate Revocation Lists (CRL) of Certification Authorities (CA) whose clients you deal with. |
| public static native boolean | Returns: true if the operation was successfulServer or Client context to use. ctx, String Certificate file. cert, String Private Key file to use if not in cert. key, String Certificate password. If null and certificate
is encrypted, password prompt will be displayed. password, int Certificate index SSL_AIDX_RSA or SSL_AIDX_DSA. idx)Set Certificate Point setCertificateFile at a PEM encoded certificate. |
| public static native boolean | Returns: true if the operation was successfulServer or Client context to use. ctx, String File of PEM-encoded Server CA Certificates. file, boolean Skip first certificate if chain file is inside
certificate file. skipfirst)Set File of PEM-encoded Server CA Certificates This directive sets the optional all-in-one file where you can assemble the certificates of Certification Authorities (CA) which form the certificate chain of the server certificate. |
| public static native boolean | Returns: true if success, false otherwise.Server or Client context to use. ctx, byte[] Byte array with the certificate in DER encoding. cert, byte[] Byte array with the Private Key file in PEM format. key, int Certificate index SSL_AIDX_RSA or SSL_AIDX_DSA. sslAidxRsa)Set CertificateRaw Use keystore a certificate and key to fill the BIOP |
| public static native void | setCertVerifyCallback(long
Server or Client context to use. ctx, CertificateVerifier the verifier to call during handshake. verifier)Allow to hook |
| public static native boolean | Returns: true if the operation was successfulServer or Client context to use. ctx, String An OpenSSL cipher specification. ciphers)Cipher Suite available for negotiation in SSL handshake. |
| public static native void | setOptions(long
Server or Client context to use. ctx, int See SSL.SSL_OP_* for option flags. options)Set OpenSSL Option. |
| public static native long | Returns: the value setServer or Client context to use. ctx, long The mode to set mode)Set the mode of the internal session cache and return the previous used mode. |
| public static native long | Returns: the value setServer or Client context to use. ctx, long The cache size size)Set the size of the internal session cache. |
| public static native long | Returns: the value setServer or Client context to use. ctx, long Timeout value timeoutSeconds)Set the timeout for the internal session cache in seconds. |
| public static native boolean | Returns: true if success, false otherwise.Server context to use. ctx, byte[] can be any kind of binary data, it is therefore possible to use e.g. the name
of the application and/or the hostname and/or service name sidCtx)Set the context within which session be reused (server side only) http://www.openssl.org/docs/ssl/SSL_CTX_set_session_id_context.html |
| public static native void | setSessionTicketKeys(long
Server or Client context to use. ctx, byte[] Some session keys keys)Set TLS session keys. |
| public static native void | setVerify(long
Server or Client context to use. ctx, int Type of Client Certificate verification. level, int Maximum depth of CA Certificates in Client Certificate
verification. depth)Set Type of Client Certificate verification and Maximum depth of CA Certificates in Client Certificate verification. |
| public static long | Returns: The Java representation of the pointer to the OpenSSL SSLContext to use for the given host or zero if no SSLContext could be identifiedThe OpenSSL SSLContext that the handshake started to
use. This will be the default OpenSSL SSLContext for
the endpoint associated with the socket. currentCtx, String The host name requested by the client sniHostName)When tc-native encounters a SNI extension in the TLS handshake it will call this method to determine which OpenSSL SSLContext to use for the connection. |
| DEFAULT_SESSION_ID_CONTEXT | back to summary |
|---|---|
| public static final byte[] DEFAULT_SESSION_ID_CONTEXT | |
| sniCallBacks | back to summary |
|---|---|
| private static final Map<Long, SSLContext. A map of default SSL Contexts to SNICallBack instances (in Tomcat these are instances of AprEndpoint) that will be used to determine the SSL Context to use bases on the SNI host name. It is structured this way since a Tomcat instance may have several TLS enabled endpoints that each have different SSL Context mappings for the same host name. | |
| SSLContext | back to summary |
|---|---|
| public SSLContext() | |
| addChainCertificateRaw | back to summary |
|---|---|
| public static native boolean addChainCertificateRaw(long ctx, byte[] cert) Add a certificate to the certificate chain. Certs should be added in
order starting with the issuer of the host certs and working up the
certificate chain to the CA.
| |
| addClientCACertificateRaw | back to summary |
|---|---|
| public static native boolean addClientCACertificateRaw(long ctx, byte[] cert) Add a CA certificate we accept as issuer for peer certs
| |
| clearOptions | back to summary |
|---|---|
| public static native void clearOptions(long ctx, int options) Clears OpenSSL Options.
| |
| free | back to summary |
|---|---|
| public static native int free(long ctx) Free the resources used by the Context
| |
| getCiphers | back to summary |
|---|---|
| public static native String[] getCiphers(long ctx) Returns all cipher suites that are enabled for negotiation in an SSL handshake.
| |
| getOptions | back to summary |
|---|---|
| public static native int getOptions(long ctx) Get OpenSSL Option.
| |
| getSessionCacheMode | back to summary |
|---|---|
| public static native long getSessionCacheMode(long ctx) Get the mode of the current used internal session cache.
| |
| getSessionCacheSize | back to summary |
|---|---|
| public static native long getSessionCacheSize(long ctx) Get the size of the internal session cache. http://www.openssl.org/docs/ssl/SSL_CTX_sess_get_cache_size.html
| |
| getSessionCacheTimeout | back to summary |
|---|---|
| public static native long getSessionCacheTimeout(long ctx) Get the timeout for the internal session cache in seconds. http://www.openssl.org/docs/ssl/SSL_CTX_set_timeout.html
| |
| make | back to summary |
|---|---|
| public static native long make(long pool, int protocol, int mode) throws Exception Create a new SSL context.
| |
| sessionAccept | back to summary |
|---|---|
| public static native long sessionAccept(long ctx) | |
| sessionAcceptGood | back to summary |
|---|---|
| public static native long sessionAcceptGood(long ctx) | |
| sessionAcceptRenegotiate | back to summary |
|---|---|
| public static native long sessionAcceptRenegotiate(long ctx) | |
| sessionCacheFull | back to summary |
|---|---|
| public static native long sessionCacheFull(long ctx) | |
| sessionCbHits | back to summary |
|---|---|
| public static native long sessionCbHits(long ctx) | |
| sessionConnect | back to summary |
|---|---|
| public static native long sessionConnect(long ctx) | |
| sessionConnectGood | back to summary |
|---|---|
| public static native long sessionConnectGood(long ctx) | |
| sessionConnectRenegotiate | back to summary |
|---|---|
| public static native long sessionConnectRenegotiate(long ctx) | |
| sessionHits | back to summary |
|---|---|
| public static native long sessionHits(long ctx) | |
| sessionMisses | back to summary |
|---|---|
| public static native long sessionMisses(long ctx) | |
| sessionNumber | back to summary |
|---|---|
| public static native long sessionNumber(long ctx) | |
| sessionTimeouts | back to summary |
|---|---|
| public static native long sessionTimeouts(long ctx) | |
| setAlpnProtos | back to summary |
|---|---|
| public static native void setAlpnProtos(long ctx, String[] alpnProtos, int selectorFailureBehavior) Set application layer protocol for application layer protocol negotiation extension
| |
| setCACertificate | back to summary |
|---|---|
| public static native boolean setCACertificate(long ctx, String file, String path) throws Exception Set File and Directory of concatenated PEM-encoded CA Certificates
for Client Auth
| |
| setCARevocation | back to summary |
|---|---|
| public static native boolean setCARevocation(long ctx, String file, String path) throws Exception Set File of concatenated PEM-encoded CA CRLs or
directory of PEM-encoded CA Certificates for Client Auth
| |
| setCertificate | back to summary |
|---|---|
| public static native boolean setCertificate(long ctx, String cert, String key, String password, int idx) throws Exception Set Certificate
| |
| setCertificateChainFile | back to summary |
|---|---|
| public static native boolean setCertificateChainFile(long ctx, String file, boolean skipfirst) Set File of PEM-encoded Server CA Certificates
| |
| setCertificateRaw | back to summary |
|---|---|
| public static native boolean setCertificateRaw(long ctx, byte[] cert, byte[] key, int sslAidxRsa) Set CertificateRaw
| |
| setCertVerifyCallback | back to summary |
|---|---|
| public static native void setCertVerifyCallback(long ctx, CertificateVerifier verifier) Allow to hook
| |
| setCipherSuite | back to summary |
|---|---|
| public static native boolean setCipherSuite(long ctx, String ciphers) throws Exception Cipher Suite available for negotiation in SSL handshake.
| |
| setOptions | back to summary |
|---|---|
| public static native void setOptions(long ctx, int options) Set OpenSSL Option.
| |
| setSessionCacheMode | back to summary |
|---|---|
| public static native long setSessionCacheMode(long ctx, long mode) Set the mode of the internal session cache and return the previous used mode.
| |
| setSessionCacheSize | back to summary |
|---|---|
| public static native long setSessionCacheSize(long ctx, long size) Set the size of the internal session cache. http://www.openssl.org/docs/ssl/SSL_CTX_sess_set_cache_size.html
| |
| setSessionCacheTimeout | back to summary |
|---|---|
| public static native long setSessionCacheTimeout(long ctx, long timeoutSeconds) Set the timeout for the internal session cache in seconds. http://www.openssl.org/docs/ssl/SSL_CTX_set_timeout.html
| |
| setSessionIdContext | back to summary |
|---|---|
| public static native boolean setSessionIdContext(long ctx, byte[] sidCtx) Set the context within which session be reused (server side only) http://www.openssl.org/docs/ssl/SSL_CTX_set_session_id_context.html
| |
| setSessionTicketKeys | back to summary |
|---|---|
| public static native void setSessionTicketKeys(long ctx, byte[] keys) Set TLS session keys. This allows us to share keys across TFEs.
| |
| setVerify | back to summary |
|---|---|
| public static native void setVerify(long ctx, int level, int depth) Set Type of Client Certificate verification and Maximum depth of CA Certificates
in Client Certificate verification.
SSL_CVERIFY_NONE - No client Certificate is required at all
SSL_CVERIFY_OPTIONAL - The client may present a valid Certificate
SSL_CVERIFY_REQUIRE - The client has to present a valid Certificate
SSL_CVERIFY_OPTIONAL_NO_CA - The client may present a valid Certificate
but it need not to be (successfully) verifiable
The depth actually is the maximum number of intermediate certificate issuers, i.e. the number of CA certificates which are max allowed to be followed while verifying the client certificate. A depth of 0 means that self-signed client certificates are accepted only, the default depth of 1 means the client certificate can be self-signed or has to be signed by a CA which is directly known to the server (i.e. the CA's certificate is under setCACertificatePath), etc.
| |
| sniCallBack | back to summary |
|---|---|
| public static long sniCallBack(long currentCtx, String sniHostName) When tc-native encounters a SNI extension in the TLS handshake it will call this method to determine which OpenSSL SSLContext to use for the connection.
| |
| Modifier and Type | Method and Description |
|---|---|
| public long | Returns: The Java representation of the pointer to the OpenSSL SSLContext to use for the given host or zero if no SSLContext could be identifiedThe host name requested by the client - must be in
lower case sniHostName)This callback is made during the TLS handshake when the client uses the SNI extension to request a specific TLS host. |
| getSslContext | back to summary |
|---|---|
| public long getSslContext(String sniHostName) This callback is made during the TLS handshake when the client uses the SNI extension to request a specific TLS host.
| |