Package org.apache.tomcat.jni
Class SSL
- java.lang.Object
- 
- org.apache.tomcat.jni.SSL
 
- 
 public final class SSL extends java.lang.ObjectSSL- Author:
- Mladen Turk
 
- 
- 
Field Summary
 - 
Constructor SummaryConstructors Constructor Description SSL()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static intcloseBIO(long bio)Deprecated.Unused.static intdoHandshake(long ssl)SSL_do_handshakestatic intfipsModeGet()Get the status of FIPS Mode.static intfipsModeSet(int mode)Enable/Disable FIPS Mode.static voidfreeBIO(long bio)BIO_freestatic voidfreeSSL(long ssl)SSL_freestatic java.lang.StringgetAlpnSelected(long ssl)SSL_get0_alpn_selectedstatic java.lang.StringgetCipherForSSL(long ssl)SSL_get_cipher.static java.lang.String[]getCiphers(long ssl)Returns all cipher suites that are enabled for negotiation in an SSL handshake.static intgetError(long ssl, int ret)Deprecated.Unused.static java.lang.StringgetErrorString(long errorNumber)Get the error number representing for the givenerrorNumber.static intgetHandshakeCount(long ssl)Return the handshake completed count.static java.lang.StringgetLastError()Deprecated.Unused.static intgetLastErrorNumber()Get the error number representing the last error OpenSSL encountered on this thread.static java.lang.StringgetNextProtoNegotiated(long ssl)Deprecated.Unused.static intgetOptions(long ssl)Get OpenSSL Option.static byte[][]getPeerCertChain(long ssl)Get the peer certificate chain ornullif non was send.static byte[]getPeerCertificate(long ssl)Get the peer certificate ornullif non was send.static intgetPostHandshakeAuthInProgress(long ssl)Is post handshake authentication in progress on this connection?static byte[]getSessionId(long ssl)Returns the ID of the session as byte array representation.static intgetShutdown(long ssl)SSL_get_shutdownstatic longgetTime(long ssl)SSL_get_timestatic java.lang.StringgetVersion(long ssl)SSL_get_versionstatic booleanhasOp(int op)Deprecated.Unused.static intinitialize(java.lang.String engine)Initialize OpenSSL support.static intisInInit(long ssl)SSL_in_init.static longmakeNetworkBIO(long ssl)Wire up internal and network BIOs for the given SSL instance.static longnewBIO(long pool, BIOCallback callback)Deprecated.Unused.static longnewSSL(long ctx, boolean server)SSL_newstatic intpendingReadableBytesInSSL(long ssl)SSL_pending.static intpendingWrittenBytesInBIO(long bio)BIO_ctrl_pending.static booleanrandLoad(java.lang.String filename)Deprecated.Unused.static booleanrandMake(java.lang.String filename, int len, boolean base64)Deprecated.Unused.static booleanrandSave(java.lang.String filename)Deprecated.Unused.static voidrandSet(java.lang.String filename)Sets global random filename.static intreadFromBIO(long bio, long rbuf, int rlen)BIO_read.static intreadFromSSL(long ssl, long rbuf, int rlen)SSL_readstatic intrenegotiate(long ssl)SSL_renegotiatestatic intrenegotiatePending(long ssl)SSL_renegotiate_pendingstatic voidsetBIO(long ssl, long rbio, long wbio)Deprecated.Unused.static booleansetCipherSuites(long ssl, java.lang.String ciphers)Returns the cipher suites available for negotiation in SSL handshake.static voidsetOptions(long ssl, int options)Set OpenSSL Option.static voidsetPassword(java.lang.String password)Deprecated.Unused.static voidsetPasswordCallback(PasswordCallback callback)Deprecated.Unused.static voidsetShutdown(long ssl, int mode)Deprecated.Unused.static voidsetVerify(long ssl, int level, int depth)Set Type of Client Certificate verification and Maximum depth of CA Certificates in Client Certificate verification.static intshutdownSSL(long ssl)SSL_shutdownstatic intverifyClientPostHandshake(long ssl)SSL_verify_client_post_handshakestatic intversion()static java.lang.StringversionString()static intwriteToBIO(long bio, long wbuf, int wlen)BIO_write.static intwriteToSSL(long ssl, long wbuf, int wlen)SSL_write.
 
- 
- 
- 
Field Detail- 
UNSETpublic static final int UNSET - See Also:
- Constant Field Values
 
 - 
SSL_ALGO_UNKNOWNpublic static final int SSL_ALGO_UNKNOWN - See Also:
- Constant Field Values
 
 - 
SSL_ALGO_RSApublic static final int SSL_ALGO_RSA - See Also:
- Constant Field Values
 
 - 
SSL_ALGO_DSApublic static final int SSL_ALGO_DSA - See Also:
- Constant Field Values
 
 - 
SSL_ALGO_ALLpublic static final int SSL_ALGO_ALL - See Also:
- Constant Field Values
 
 - 
SSL_AIDX_RSApublic static final int SSL_AIDX_RSA - See Also:
- Constant Field Values
 
 - 
SSL_AIDX_DSApublic static final int SSL_AIDX_DSA - See Also:
- Constant Field Values
 
 - 
SSL_AIDX_ECCpublic static final int SSL_AIDX_ECC - See Also:
- Constant Field Values
 
 - 
SSL_AIDX_MAXpublic static final int SSL_AIDX_MAX - See Also:
- Constant Field Values
 
 - 
SSL_TMP_KEY_RSA_512public static final int SSL_TMP_KEY_RSA_512 - See Also:
- Constant Field Values
 
 - 
SSL_TMP_KEY_RSA_1024public static final int SSL_TMP_KEY_RSA_1024 - See Also:
- Constant Field Values
 
 - 
SSL_TMP_KEY_RSA_2048public static final int SSL_TMP_KEY_RSA_2048 - See Also:
- Constant Field Values
 
 - 
SSL_TMP_KEY_RSA_4096public static final int SSL_TMP_KEY_RSA_4096 - See Also:
- Constant Field Values
 
 - 
SSL_TMP_KEY_DH_512public static final int SSL_TMP_KEY_DH_512 - See Also:
- Constant Field Values
 
 - 
SSL_TMP_KEY_DH_1024public static final int SSL_TMP_KEY_DH_1024 - See Also:
- Constant Field Values
 
 - 
SSL_TMP_KEY_DH_2048public static final int SSL_TMP_KEY_DH_2048 - See Also:
- Constant Field Values
 
 - 
SSL_TMP_KEY_DH_4096public static final int SSL_TMP_KEY_DH_4096 - See Also:
- Constant Field Values
 
 - 
SSL_TMP_KEY_MAXpublic static final int SSL_TMP_KEY_MAX - See Also:
- Constant Field Values
 
 - 
SSL_OPT_NONEpublic static final int SSL_OPT_NONE - See Also:
- Constant Field Values
 
 - 
SSL_OPT_RELSETpublic static final int SSL_OPT_RELSET - See Also:
- Constant Field Values
 
 - 
SSL_OPT_STDENVVARSpublic static final int SSL_OPT_STDENVVARS - See Also:
- Constant Field Values
 
 - 
SSL_OPT_EXPORTCERTDATApublic static final int SSL_OPT_EXPORTCERTDATA - See Also:
- Constant Field Values
 
 - 
SSL_OPT_FAKEBASICAUTHpublic static final int SSL_OPT_FAKEBASICAUTH - See Also:
- Constant Field Values
 
 - 
SSL_OPT_STRICTREQUIREpublic static final int SSL_OPT_STRICTREQUIRE - See Also:
- Constant Field Values
 
 - 
SSL_OPT_OPTRENEGOTIATEpublic static final int SSL_OPT_OPTRENEGOTIATE - See Also:
- Constant Field Values
 
 - 
SSL_OPT_ALLpublic static final int SSL_OPT_ALL - See Also:
- Constant Field Values
 
 - 
SSL_PROTOCOL_NONEpublic static final int SSL_PROTOCOL_NONE - See Also:
- Constant Field Values
 
 - 
SSL_PROTOCOL_SSLV2public static final int SSL_PROTOCOL_SSLV2 - See Also:
- Constant Field Values
 
 - 
SSL_PROTOCOL_SSLV3public static final int SSL_PROTOCOL_SSLV3 - See Also:
- Constant Field Values
 
 - 
SSL_PROTOCOL_TLSV1public static final int SSL_PROTOCOL_TLSV1 - See Also:
- Constant Field Values
 
 - 
SSL_PROTOCOL_TLSV1_1public static final int SSL_PROTOCOL_TLSV1_1 - See Also:
- Constant Field Values
 
 - 
SSL_PROTOCOL_TLSV1_2public static final int SSL_PROTOCOL_TLSV1_2 - See Also:
- Constant Field Values
 
 - 
SSL_PROTOCOL_TLSV1_3public static final int SSL_PROTOCOL_TLSV1_3 - See Also:
- Constant Field Values
 
 - 
SSL_PROTOCOL_ALLpublic static final int SSL_PROTOCOL_ALL 
 - 
SSL_CVERIFY_UNSETpublic static final int SSL_CVERIFY_UNSET - See Also:
- Constant Field Values
 
 - 
SSL_CVERIFY_NONEpublic static final int SSL_CVERIFY_NONE - See Also:
- Constant Field Values
 
 - 
SSL_CVERIFY_OPTIONALpublic static final int SSL_CVERIFY_OPTIONAL - See Also:
- Constant Field Values
 
 - 
SSL_CVERIFY_REQUIREpublic static final int SSL_CVERIFY_REQUIRE - See Also:
- Constant Field Values
 
 - 
SSL_CVERIFY_OPTIONAL_NO_CApublic static final int SSL_CVERIFY_OPTIONAL_NO_CA - See Also:
- Constant Field Values
 
 - 
SSL_VERIFY_NONEpublic static final int SSL_VERIFY_NONE - See Also:
- Constant Field Values
 
 - 
SSL_VERIFY_PEERpublic static final int SSL_VERIFY_PEER - See Also:
- Constant Field Values
 
 - 
SSL_VERIFY_FAIL_IF_NO_PEER_CERTpublic static final int SSL_VERIFY_FAIL_IF_NO_PEER_CERT - See Also:
- Constant Field Values
 
 - 
SSL_VERIFY_CLIENT_ONCEpublic static final int SSL_VERIFY_CLIENT_ONCE - See Also:
- Constant Field Values
 
 - 
SSL_VERIFY_PEER_STRICTpublic static final int SSL_VERIFY_PEER_STRICT - See Also:
- Constant Field Values
 
 - 
SSL_OP_MICROSOFT_SESS_ID_BUGpublic static final int SSL_OP_MICROSOFT_SESS_ID_BUG - See Also:
- Constant Field Values
 
 - 
SSL_OP_NETSCAPE_CHALLENGE_BUGpublic static final int SSL_OP_NETSCAPE_CHALLENGE_BUG - See Also:
- Constant Field Values
 
 - 
SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUGpublic static final int SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG - See Also:
- Constant Field Values
 
 - 
SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUGpublic static final int SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG - See Also:
- Constant Field Values
 
 - 
SSL_OP_MICROSOFT_BIG_SSLV3_BUFFERpublic static final int SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER - See Also:
- Constant Field Values
 
 - 
SSL_OP_MSIE_SSLV2_RSA_PADDINGpublic static final int SSL_OP_MSIE_SSLV2_RSA_PADDING - See Also:
- Constant Field Values
 
 - 
SSL_OP_SSLEAY_080_CLIENT_DH_BUGpublic static final int SSL_OP_SSLEAY_080_CLIENT_DH_BUG - See Also:
- Constant Field Values
 
 - 
SSL_OP_TLS_D5_BUGpublic static final int SSL_OP_TLS_D5_BUG - See Also:
- Constant Field Values
 
 - 
SSL_OP_TLS_BLOCK_PADDING_BUGpublic static final int SSL_OP_TLS_BLOCK_PADDING_BUG - See Also:
- Constant Field Values
 
 - 
SSL_OP_DONT_INSERT_EMPTY_FRAGMENTSpublic static final int SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS - See Also:
- Constant Field Values
 
 - 
SSL_OP_ALLpublic static final int SSL_OP_ALL - See Also:
- Constant Field Values
 
 - 
SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATIONpublic static final int SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION - See Also:
- Constant Field Values
 
 - 
SSL_OP_NO_COMPRESSIONpublic static final int SSL_OP_NO_COMPRESSION - See Also:
- Constant Field Values
 
 - 
SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATIONpublic static final int SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION - See Also:
- Constant Field Values
 
 - 
SSL_OP_SINGLE_ECDH_USEpublic static final int SSL_OP_SINGLE_ECDH_USE - See Also:
- Constant Field Values
 
 - 
SSL_OP_SINGLE_DH_USEpublic static final int SSL_OP_SINGLE_DH_USE - See Also:
- Constant Field Values
 
 - 
SSL_OP_EPHEMERAL_RSApublic static final int SSL_OP_EPHEMERAL_RSA - See Also:
- Constant Field Values
 
 - 
SSL_OP_CIPHER_SERVER_PREFERENCEpublic static final int SSL_OP_CIPHER_SERVER_PREFERENCE - See Also:
- Constant Field Values
 
 - 
SSL_OP_TLS_ROLLBACK_BUGpublic static final int SSL_OP_TLS_ROLLBACK_BUG - See Also:
- Constant Field Values
 
 - 
SSL_OP_NO_SSLv2public static final int SSL_OP_NO_SSLv2 - See Also:
- Constant Field Values
 
 - 
SSL_OP_NO_SSLv3public static final int SSL_OP_NO_SSLv3 - See Also:
- Constant Field Values
 
 - 
SSL_OP_NO_TLSv1public static final int SSL_OP_NO_TLSv1 - See Also:
- Constant Field Values
 
 - 
SSL_OP_NO_TLSv1_2public static final int SSL_OP_NO_TLSv1_2 - See Also:
- Constant Field Values
 
 - 
SSL_OP_NO_TLSv1_1public static final int SSL_OP_NO_TLSv1_1 - See Also:
- Constant Field Values
 
 - 
SSL_OP_NO_TICKETpublic static final int SSL_OP_NO_TICKET - See Also:
- Constant Field Values
 
 - 
SSL_OP_PKCS1_CHECK_1@Deprecated public static final int SSL_OP_PKCS1_CHECK_1 Deprecated.Unsupported in the current version of OpenSSL- See Also:
- Constant Field Values
 
 - 
SSL_OP_PKCS1_CHECK_2@Deprecated public static final int SSL_OP_PKCS1_CHECK_2 Deprecated.Unsupported in the current version of OpenSSL- See Also:
- Constant Field Values
 
 - 
SSL_OP_NETSCAPE_CA_DN_BUGpublic static final int SSL_OP_NETSCAPE_CA_DN_BUG - See Also:
- Constant Field Values
 
 - 
SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUGpublic static final int SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG - See Also:
- Constant Field Values
 
 - 
SSL_CRT_FORMAT_UNDEFpublic static final int SSL_CRT_FORMAT_UNDEF - See Also:
- Constant Field Values
 
 - 
SSL_CRT_FORMAT_ASN1public static final int SSL_CRT_FORMAT_ASN1 - See Also:
- Constant Field Values
 
 - 
SSL_CRT_FORMAT_TEXTpublic static final int SSL_CRT_FORMAT_TEXT - See Also:
- Constant Field Values
 
 - 
SSL_CRT_FORMAT_PEMpublic static final int SSL_CRT_FORMAT_PEM - See Also:
- Constant Field Values
 
 - 
SSL_CRT_FORMAT_NETSCAPEpublic static final int SSL_CRT_FORMAT_NETSCAPE - See Also:
- Constant Field Values
 
 - 
SSL_CRT_FORMAT_PKCS12public static final int SSL_CRT_FORMAT_PKCS12 - See Also:
- Constant Field Values
 
 - 
SSL_CRT_FORMAT_SMIMEpublic static final int SSL_CRT_FORMAT_SMIME - See Also:
- Constant Field Values
 
 - 
SSL_CRT_FORMAT_ENGINEpublic static final int SSL_CRT_FORMAT_ENGINE - See Also:
- Constant Field Values
 
 - 
SSL_MODE_CLIENTpublic static final int SSL_MODE_CLIENT - See Also:
- Constant Field Values
 
 - 
SSL_MODE_SERVERpublic static final int SSL_MODE_SERVER - See Also:
- Constant Field Values
 
 - 
SSL_MODE_COMBINEDpublic static final int SSL_MODE_COMBINED - See Also:
- Constant Field Values
 
 - 
SSL_CONF_FLAG_CMDLINEpublic static final int SSL_CONF_FLAG_CMDLINE - See Also:
- Constant Field Values
 
 - 
SSL_CONF_FLAG_FILEpublic static final int SSL_CONF_FLAG_FILE - See Also:
- Constant Field Values
 
 - 
SSL_CONF_FLAG_CLIENTpublic static final int SSL_CONF_FLAG_CLIENT - See Also:
- Constant Field Values
 
 - 
SSL_CONF_FLAG_SERVERpublic static final int SSL_CONF_FLAG_SERVER - See Also:
- Constant Field Values
 
 - 
SSL_CONF_FLAG_SHOW_ERRORSpublic static final int SSL_CONF_FLAG_SHOW_ERRORS - See Also:
- Constant Field Values
 
 - 
SSL_CONF_FLAG_CERTIFICATEpublic static final int SSL_CONF_FLAG_CERTIFICATE - See Also:
- Constant Field Values
 
 - 
SSL_CONF_TYPE_UNKNOWNpublic static final int SSL_CONF_TYPE_UNKNOWN - See Also:
- Constant Field Values
 
 - 
SSL_CONF_TYPE_STRINGpublic static final int SSL_CONF_TYPE_STRING - See Also:
- Constant Field Values
 
 - 
SSL_CONF_TYPE_FILEpublic static final int SSL_CONF_TYPE_FILE - See Also:
- Constant Field Values
 
 - 
SSL_CONF_TYPE_DIRpublic static final int SSL_CONF_TYPE_DIR - See Also:
- Constant Field Values
 
 - 
SSL_SHUTDOWN_TYPE_UNSETpublic static final int SSL_SHUTDOWN_TYPE_UNSET - See Also:
- Constant Field Values
 
 - 
SSL_SHUTDOWN_TYPE_STANDARDpublic static final int SSL_SHUTDOWN_TYPE_STANDARD - See Also:
- Constant Field Values
 
 - 
SSL_SHUTDOWN_TYPE_UNCLEANpublic static final int SSL_SHUTDOWN_TYPE_UNCLEAN - See Also:
- Constant Field Values
 
 - 
SSL_SHUTDOWN_TYPE_ACCURATEpublic static final int SSL_SHUTDOWN_TYPE_ACCURATE - See Also:
- Constant Field Values
 
 - 
SSL_INFO_SESSION_IDpublic static final int SSL_INFO_SESSION_ID - See Also:
- Constant Field Values
 
 - 
SSL_INFO_CIPHERpublic static final int SSL_INFO_CIPHER - See Also:
- Constant Field Values
 
 - 
SSL_INFO_CIPHER_USEKEYSIZEpublic static final int SSL_INFO_CIPHER_USEKEYSIZE - See Also:
- Constant Field Values
 
 - 
SSL_INFO_CIPHER_ALGKEYSIZEpublic static final int SSL_INFO_CIPHER_ALGKEYSIZE - See Also:
- Constant Field Values
 
 - 
SSL_INFO_CIPHER_VERSIONpublic static final int SSL_INFO_CIPHER_VERSION - See Also:
- Constant Field Values
 
 - 
SSL_INFO_CIPHER_DESCRIPTIONpublic static final int SSL_INFO_CIPHER_DESCRIPTION - See Also:
- Constant Field Values
 
 - 
SSL_INFO_PROTOCOLpublic static final int SSL_INFO_PROTOCOL - See Also:
- Constant Field Values
 
 - 
SSL_INFO_CLIENT_S_DNpublic static final int SSL_INFO_CLIENT_S_DN - See Also:
- Constant Field Values
 
 - 
SSL_INFO_CLIENT_I_DNpublic static final int SSL_INFO_CLIENT_I_DN - See Also:
- Constant Field Values
 
 - 
SSL_INFO_SERVER_S_DNpublic static final int SSL_INFO_SERVER_S_DN - See Also:
- Constant Field Values
 
 - 
SSL_INFO_SERVER_I_DNpublic static final int SSL_INFO_SERVER_I_DN - See Also:
- Constant Field Values
 
 - 
SSL_INFO_DN_COUNTRYNAMEpublic static final int SSL_INFO_DN_COUNTRYNAME - See Also:
- Constant Field Values
 
 - 
SSL_INFO_DN_STATEORPROVINCENAMEpublic static final int SSL_INFO_DN_STATEORPROVINCENAME - See Also:
- Constant Field Values
 
 - 
SSL_INFO_DN_LOCALITYNAMEpublic static final int SSL_INFO_DN_LOCALITYNAME - See Also:
- Constant Field Values
 
 - 
SSL_INFO_DN_ORGANIZATIONNAMEpublic static final int SSL_INFO_DN_ORGANIZATIONNAME - See Also:
- Constant Field Values
 
 - 
SSL_INFO_DN_ORGANIZATIONALUNITNAMEpublic static final int SSL_INFO_DN_ORGANIZATIONALUNITNAME - See Also:
- Constant Field Values
 
 - 
SSL_INFO_DN_COMMONNAMEpublic static final int SSL_INFO_DN_COMMONNAME - See Also:
- Constant Field Values
 
 - 
SSL_INFO_DN_TITLEpublic static final int SSL_INFO_DN_TITLE - See Also:
- Constant Field Values
 
 - 
SSL_INFO_DN_INITIALSpublic static final int SSL_INFO_DN_INITIALS - See Also:
- Constant Field Values
 
 - 
SSL_INFO_DN_GIVENNAMEpublic static final int SSL_INFO_DN_GIVENNAME - See Also:
- Constant Field Values
 
 - 
SSL_INFO_DN_SURNAMEpublic static final int SSL_INFO_DN_SURNAME - See Also:
- Constant Field Values
 
 - 
SSL_INFO_DN_DESCRIPTIONpublic static final int SSL_INFO_DN_DESCRIPTION - See Also:
- Constant Field Values
 
 - 
SSL_INFO_DN_UNIQUEIDENTIFIERpublic static final int SSL_INFO_DN_UNIQUEIDENTIFIER - See Also:
- Constant Field Values
 
 - 
SSL_INFO_DN_EMAILADDRESSpublic static final int SSL_INFO_DN_EMAILADDRESS - See Also:
- Constant Field Values
 
 - 
SSL_INFO_CLIENT_M_VERSIONpublic static final int SSL_INFO_CLIENT_M_VERSION - See Also:
- Constant Field Values
 
 - 
SSL_INFO_CLIENT_M_SERIALpublic static final int SSL_INFO_CLIENT_M_SERIAL - See Also:
- Constant Field Values
 
 - 
SSL_INFO_CLIENT_V_STARTpublic static final int SSL_INFO_CLIENT_V_START - See Also:
- Constant Field Values
 
 - 
SSL_INFO_CLIENT_V_ENDpublic static final int SSL_INFO_CLIENT_V_END - See Also:
- Constant Field Values
 
 - 
SSL_INFO_CLIENT_A_SIGpublic static final int SSL_INFO_CLIENT_A_SIG - See Also:
- Constant Field Values
 
 - 
SSL_INFO_CLIENT_A_KEYpublic static final int SSL_INFO_CLIENT_A_KEY - See Also:
- Constant Field Values
 
 - 
SSL_INFO_CLIENT_CERTpublic static final int SSL_INFO_CLIENT_CERT - See Also:
- Constant Field Values
 
 - 
SSL_INFO_CLIENT_V_REMAINpublic static final int SSL_INFO_CLIENT_V_REMAIN - See Also:
- Constant Field Values
 
 - 
SSL_INFO_SERVER_M_VERSIONpublic static final int SSL_INFO_SERVER_M_VERSION - See Also:
- Constant Field Values
 
 - 
SSL_INFO_SERVER_M_SERIALpublic static final int SSL_INFO_SERVER_M_SERIAL - See Also:
- Constant Field Values
 
 - 
SSL_INFO_SERVER_V_STARTpublic static final int SSL_INFO_SERVER_V_START - See Also:
- Constant Field Values
 
 - 
SSL_INFO_SERVER_V_ENDpublic static final int SSL_INFO_SERVER_V_END - See Also:
- Constant Field Values
 
 - 
SSL_INFO_SERVER_A_SIGpublic static final int SSL_INFO_SERVER_A_SIG - See Also:
- Constant Field Values
 
 - 
SSL_INFO_SERVER_A_KEYpublic static final int SSL_INFO_SERVER_A_KEY - See Also:
- Constant Field Values
 
 - 
SSL_INFO_SERVER_CERTpublic static final int SSL_INFO_SERVER_CERT - See Also:
- Constant Field Values
 
 - 
SSL_INFO_CLIENT_CERT_CHAINpublic static final int SSL_INFO_CLIENT_CERT_CHAIN - See Also:
- Constant Field Values
 
 - 
SSL_SESS_CACHE_OFFpublic static final long SSL_SESS_CACHE_OFF - See Also:
- Constant Field Values
 
 - 
SSL_SESS_CACHE_SERVERpublic static final long SSL_SESS_CACHE_SERVER - See Also:
- Constant Field Values
 
 - 
SSL_SELECTOR_FAILURE_NO_ADVERTISEpublic static final int SSL_SELECTOR_FAILURE_NO_ADVERTISE - See Also:
- Constant Field Values
 
 - 
SSL_SELECTOR_FAILURE_CHOOSE_MY_LAST_PROTOCOLpublic static final int SSL_SELECTOR_FAILURE_CHOOSE_MY_LAST_PROTOCOL - See Also:
- Constant Field Values
 
 - 
SSL_SENT_SHUTDOWNpublic static final int SSL_SENT_SHUTDOWN - See Also:
- Constant Field Values
 
 - 
SSL_RECEIVED_SHUTDOWNpublic static final int SSL_RECEIVED_SHUTDOWN - See Also:
- Constant Field Values
 
 - 
SSL_ERROR_NONEpublic static final int SSL_ERROR_NONE - See Also:
- Constant Field Values
 
 - 
SSL_ERROR_SSLpublic static final int SSL_ERROR_SSL - See Also:
- Constant Field Values
 
 - 
SSL_ERROR_WANT_READpublic static final int SSL_ERROR_WANT_READ - See Also:
- Constant Field Values
 
 - 
SSL_ERROR_WANT_WRITEpublic static final int SSL_ERROR_WANT_WRITE - See Also:
- Constant Field Values
 
 - 
SSL_ERROR_WANT_X509_LOOKUPpublic static final int SSL_ERROR_WANT_X509_LOOKUP - See Also:
- Constant Field Values
 
 - 
SSL_ERROR_SYSCALLpublic static final int SSL_ERROR_SYSCALL - See Also:
- Constant Field Values
 
 - 
SSL_ERROR_ZERO_RETURNpublic static final int SSL_ERROR_ZERO_RETURN - See Also:
- Constant Field Values
 
 - 
SSL_ERROR_WANT_CONNECTpublic static final int SSL_ERROR_WANT_CONNECT - See Also:
- Constant Field Values
 
 - 
SSL_ERROR_WANT_ACCEPTpublic static final int SSL_ERROR_WANT_ACCEPT - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
versionpublic static int version() 
 - 
versionStringpublic static java.lang.String versionString() 
 - 
initializepublic static int initialize(java.lang.String engine) Initialize OpenSSL support. This function needs to be called once for the lifetime of JVM. Library.init() has to be called before.- Parameters:
- engine- Support for external a Crypto Device ("engine"), usually a hardware accelerator card for crypto operations.
- Returns:
- APR status code
 
 - 
fipsModeGetpublic static int fipsModeGet() throws java.lang.ExceptionGet the status of FIPS Mode.- Returns:
- FIPS_mode return code. It is 0if OpenSSL is not in FIPS mode,1if OpenSSL is in FIPS Mode.
- Throws:
- java.lang.Exception- If tcnative was not compiled with FIPS Mode available.
- See Also:
- OpenSSL method FIPS_mode()
 
 - 
fipsModeSetpublic static int fipsModeSet(int mode) throws java.lang.ExceptionEnable/Disable FIPS Mode.- Parameters:
- mode- 1 - enable, 0 - disable
- Returns:
- FIPS_mode_set return code
- Throws:
- java.lang.Exception- If tcnative was not compiled with FIPS Mode available, or if- FIPS_mode_set()call returned an error value.
- See Also:
- OpenSSL method FIPS_mode_set()
 
 - 
randLoad@Deprecated public static boolean randLoad(java.lang.String filename) Deprecated.Unused. Will be removed in Tomcat 10.1Add content of the file to the PRNG- Parameters:
- filename- Filename containing random data. If null the default file will be tested. The seed file is $RANDFILE if that environment variable is set, $HOME/.rnd otherwise. In case both files are unavailable builtin random seed generator is used.
- Returns:
- trueif the operation was successful
 
 - 
randSave@Deprecated public static boolean randSave(java.lang.String filename) Deprecated.Unused. Will be removed in Tomcat 10.1Writes a number of random bytes (currently 1024) to filefilenamewhich can be used to initialize the PRNG by calling randLoad in a later session.- Parameters:
- filename- Filename to save the data
- Returns:
- trueif the operation was successful
 
 - 
randMake@Deprecated public static boolean randMake(java.lang.String filename, int len, boolean base64)Deprecated.Unused. Will be removed in Tomcat 10.1Creates random data to filename- Parameters:
- filename- Filename to save the data
- len- The length of random sequence in bytes
- base64- Output the data in Base64 encoded format
- Returns:
- trueif the operation was successful
 
 - 
randSetpublic static void randSet(java.lang.String filename) Sets global random filename.- Parameters:
- filename- Filename to use. If set it will be used for SSL initialization and all contexts where explicitly not set.
 
 - 
newBIO@Deprecated public static long newBIO(long pool, BIOCallback callback) throws java.lang.ExceptionDeprecated.Unused. Will be removed in Tomcat 10.1Initialize new BIO- Parameters:
- pool- The pool to use.
- callback- BIOCallback to use
- Returns:
- New BIO handle
- Throws:
- java.lang.Exception- An error occurred
 
 - 
closeBIO@Deprecated public static int closeBIO(long bio) Deprecated.Unused. Will be removed in Tomcat 10.1Close BIO and dereference callback object- Parameters:
- bio- BIO to close and destroy.
- Returns:
- APR Status code
 
 - 
setPasswordCallback@Deprecated public static void setPasswordCallback(PasswordCallback callback) Deprecated.Unused. Will be removed in Tomcat 10.1Set global Password callback for obtaining passwords.- Parameters:
- callback- PasswordCallback implementation to use.
 
 - 
setPassword@Deprecated public static void setPassword(java.lang.String password) Deprecated.Unused. Will be removed in Tomcat 10.1Set global Password for decrypting certificates and keys.- Parameters:
- password- Password to use.
 
 - 
getLastError@Deprecated public static java.lang.String getLastError() Deprecated.Unused. Will be removed in Tomcat 10.1Return last SSL error string- Returns:
- the error string
 
 - 
hasOp@Deprecated public static boolean hasOp(int op) Deprecated.Unused. Will be removed in Tomcat 10.1Return true if all the requested SSL_OP_* are supported by OpenSSL. Note that for versions of tcnative < 1.1.25, this method will returntrueif and only ifop=SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATIONand tcnative supports that flag.- Parameters:
- op- Bitwise-OR of all SSL_OP_* to test.
- Returns:
- true if all SSL_OP_* are supported by OpenSSL library.
 
 - 
getHandshakeCountpublic static int getHandshakeCount(long ssl) Return the handshake completed count.- Parameters:
- ssl- SSL pointer
- Returns:
- the count
 
 - 
newSSLpublic static long newSSL(long ctx, boolean server)SSL_new- Parameters:
- ctx- Server or Client context to use.
- server- if true configure SSL instance to use accept handshake routines if false configure SSL instance to use connect handshake routines
- Returns:
- pointer to SSL instance (SSL *)
 
 - 
setBIO@Deprecated public static void setBIO(long ssl, long rbio, long wbio)Deprecated.Unused. Will be removed in Tomcat 10.1SSL_set_bio- Parameters:
- ssl- SSL pointer (SSL *)
- rbio- read BIO pointer (BIO *)
- wbio- write BIO pointer (BIO *)
 
 - 
getError@Deprecated public static int getError(long ssl, int ret)Deprecated.Unused. Will be removed in Tomcat 10.1SSL_get_error- Parameters:
- ssl- SSL pointer (SSL *)
- ret- TLS/SSL I/O return value
- Returns:
- the error status
 
 - 
pendingWrittenBytesInBIOpublic static int pendingWrittenBytesInBIO(long bio) BIO_ctrl_pending.- Parameters:
- bio- BIO pointer (BIO *)
- Returns:
- the pending bytes count
 
 - 
pendingReadableBytesInSSLpublic static int pendingReadableBytesInSSL(long ssl) SSL_pending.- Parameters:
- ssl- SSL pointer (SSL *)
- Returns:
- the pending bytes count
 
 - 
writeToBIOpublic static int writeToBIO(long bio, long wbuf, int wlen)BIO_write.- Parameters:
- bio- BIO pointer
- wbuf- Buffer pointer
- wlen- Write length
- Returns:
- the bytes count written
 
 - 
readFromBIOpublic static int readFromBIO(long bio, long rbuf, int rlen)BIO_read.- Parameters:
- bio- BIO pointer
- rbuf- Buffer pointer
- rlen- Read length
- Returns:
- the bytes count read
 
 - 
writeToSSLpublic static int writeToSSL(long ssl, long wbuf, int wlen)SSL_write.- Parameters:
- ssl- the SSL instance (SSL *)
- wbuf- Buffer pointer
- wlen- Write length
- Returns:
- the bytes count written
 
 - 
readFromSSLpublic static int readFromSSL(long ssl, long rbuf, int rlen)SSL_read- Parameters:
- ssl- the SSL instance (SSL *)
- rbuf- Buffer pointer
- rlen- Read length
- Returns:
- the bytes count read
 
 - 
getShutdownpublic static int getShutdown(long ssl) SSL_get_shutdown- Parameters:
- ssl- the SSL instance (SSL *)
- Returns:
- the operation status
 
 - 
setShutdown@Deprecated public static void setShutdown(long ssl, int mode)Deprecated.Unused. Will be removed in Tomcat 10.1SSL_set_shutdown- Parameters:
- ssl- the SSL instance (SSL *)
- mode- Shutdown mode
 
 - 
freeSSLpublic static void freeSSL(long ssl) SSL_free- Parameters:
- ssl- the SSL instance (SSL *)
 
 - 
makeNetworkBIOpublic static long makeNetworkBIO(long ssl) Wire up internal and network BIOs for the given SSL instance. Warning: you must explicitly free this resource by calling freeBIO While the SSL's internal/application data BIO will be freed when freeSSL is called on the provided SSL instance, you must call freeBIO on the returned network BIO.- Parameters:
- ssl- the SSL instance (SSL *)
- Returns:
- pointer to the Network BIO (BIO *)
 
 - 
freeBIOpublic static void freeBIO(long bio) BIO_free- Parameters:
- bio- BIO pointer
 
 - 
shutdownSSLpublic static int shutdownSSL(long ssl) SSL_shutdown- Parameters:
- ssl- the SSL instance (SSL *)
- Returns:
- the operation status
 
 - 
getLastErrorNumberpublic static int getLastErrorNumber() Get the error number representing the last error OpenSSL encountered on this thread.- Returns:
- the last error number
 
 - 
getCipherForSSLpublic static java.lang.String getCipherForSSL(long ssl) SSL_get_cipher.- Parameters:
- ssl- the SSL instance (SSL *)
- Returns:
- the cipher name
 
 - 
getVersionpublic static java.lang.String getVersion(long ssl) SSL_get_version- Parameters:
- ssl- the SSL instance (SSL *)
- Returns:
- the SSL version in use
 
 - 
doHandshakepublic static int doHandshake(long ssl) SSL_do_handshake- Parameters:
- ssl- the SSL instance (SSL *)
- Returns:
- the handshake status
 
 - 
renegotiatepublic static int renegotiate(long ssl) SSL_renegotiate- Parameters:
- ssl- the SSL instance (SSL *)
- Returns:
- the operation status
 
 - 
renegotiatePendingpublic static int renegotiatePending(long ssl) SSL_renegotiate_pending- Parameters:
- ssl- the SSL instance (SSL *)
- Returns:
- the operation status
 
 - 
verifyClientPostHandshakepublic static int verifyClientPostHandshake(long ssl) SSL_verify_client_post_handshake- Parameters:
- ssl- the SSL instance (SSL *)
- Returns:
- the operation status
 
 - 
getPostHandshakeAuthInProgresspublic static int getPostHandshakeAuthInProgress(long ssl) Is post handshake authentication in progress on this connection?- Parameters:
- ssl- the SSL instance (SSL *)
- Returns:
- the operation status
 
 - 
isInInitpublic static int isInInit(long ssl) SSL_in_init.- Parameters:
- ssl- the SSL instance (SSL *)
- Returns:
- the status
 
 - 
getNextProtoNegotiated@Deprecated public static java.lang.String getNextProtoNegotiated(long ssl) Deprecated.Unused. Will be removed in Tomcat 10.1.xSSL_get0_next_proto_negotiated- Parameters:
- ssl- the SSL instance (SSL *)
- Returns:
- the NPN protocol negotiated
 
 - 
getAlpnSelectedpublic static java.lang.String getAlpnSelected(long ssl) SSL_get0_alpn_selected- Parameters:
- ssl- the SSL instance (SSL *)
- Returns:
- the ALPN protocol negotiated
 
 - 
getPeerCertChainpublic static byte[][] getPeerCertChain(long ssl) Get the peer certificate chain ornullif non was send.- Parameters:
- ssl- the SSL instance (SSL *)
- Returns:
- the certificate chain bytes
 
 - 
getPeerCertificatepublic static byte[] getPeerCertificate(long ssl) Get the peer certificate ornullif non was send.- Parameters:
- ssl- the SSL instance (SSL *)
- Returns:
- the certificate bytes
 
 - 
getErrorStringpublic static java.lang.String getErrorString(long errorNumber) Get the error number representing for the givenerrorNumber.- Parameters:
- errorNumber- The error code
- Returns:
- an error message
 
 - 
getTimepublic static long getTime(long ssl) SSL_get_time- Parameters:
- ssl- the SSL instance (SSL *)
- Returns:
- returns the time at which the session ssl was established. The time is given in seconds since the Epoch
 
 - 
setVerifypublic static void setVerify(long ssl, int level, int depth)Set Type of Client Certificate verification and Maximum depth of CA Certificates in Client Certificate verification.
 This directive sets the Certificate verification level for the Client Authentication. Notice that this directive can be used both in per-server and per-directory context. In per-server context it applies to the client authentication process used in the standard SSL handshake when a connection is established. In per-directory context it forces an SSL renegotiation with the reconfigured client verification level after the HTTP request was read but before the HTTP response is sent.
 The following levels are available for level: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 undersetCACertificatePath, etc.- Parameters:
- ssl- the SSL instance (SSL *)
- level- Type of Client Certificate verification.
- depth- Maximum depth of CA Certificates in Client Certificate verification.
 
 - 
setOptionspublic static void setOptions(long ssl, int options)Set OpenSSL Option.- Parameters:
- ssl- the SSL instance (SSL *)
- options- See SSL.SSL_OP_* for option flags.
 
 - 
getOptionspublic static int getOptions(long ssl) Get OpenSSL Option.- Parameters:
- ssl- the SSL instance (SSL *)
- Returns:
- options See SSL.SSL_OP_* for option flags.
 
 - 
getCipherspublic static java.lang.String[] getCiphers(long ssl) Returns all cipher suites that are enabled for negotiation in an SSL handshake.- Parameters:
- ssl- the SSL instance (SSL *)
- Returns:
- ciphers
 
 - 
setCipherSuitespublic static boolean setCipherSuites(long ssl, java.lang.String ciphers) throws java.lang.ExceptionReturns the cipher suites available for negotiation in SSL handshake.
 This complex directive uses a colon-separated cipher-spec string consisting of OpenSSL cipher specifications to configure the Cipher Suite the client is permitted to negotiate in the SSL handshake phase. Notice that this directive can be used both in per-server and per-directory context. In per-server context it applies to the standard SSL handshake when a connection is established. In per-directory context it forces an SSL renegotiation with the reconfigured Cipher Suite after the HTTP request was read but before the HTTP response is sent.- Parameters:
- ssl- the SSL instance (SSL *)
- ciphers- an SSL cipher specification
- Returns:
- trueif the operation was successful
- Throws:
- java.lang.Exception- An error occurred
 
 - 
getSessionIdpublic static byte[] getSessionId(long ssl) Returns the ID of the session as byte array representation.- Parameters:
- ssl- the SSL instance (SSL *)
- Returns:
- the session as byte array representation obtained via SSL_SESSION_get_id.
 
 
- 
 
-