类 ExportControlled


  • public class ExportControlled
    extends Object
    Holds functionality that falls under export-control regulations.
    • 方法详细资料

      • enabled

        public static boolean enabled()
      • checkValidProtocols

        public static void checkValidProtocols​(List<String> protocols)
      • performTlsHandshake

        public static Socket performTlsHandshake​(Socket rawSocket,
                                                 SocketConnection socketConnection,
                                                 ServerVersion serverVersion,
                                                 Log log)
                                          throws IOException,
                                                 SSLParamsException,
                                                 FeatureNotAvailableException
        Converts the socket being used in the given SocketConnection to an SSLSocket by performing the SSL/TLS handshake.
        参数:
        rawSocket - original non-SSL socket
        socketConnection - the Protocol instance containing the socket to convert to an SSLSocket.
        serverVersion - ServerVersion object
        log - Logger
        返回:
        SSL socket
        抛出:
        IOException - if i/o exception occurs
        SSLParamsException - if the handshake fails, or if this distribution of Connector/J doesn't contain the SSL crypto hooks needed to perform the handshake.
        FeatureNotAvailableException - if TLS is not supported
      • getSSLContext

        public static SSLContext getSSLContext​(com.mysql.cj.protocol.ExportControlled.KeyStoreConf clientCertificateKeyStore,
                                               com.mysql.cj.protocol.ExportControlled.KeyStoreConf trustCertificateKeyStore,
                                               boolean fallbackToDefaultTrustStore,
                                               boolean verifyServerCert,
                                               String hostName,
                                               ExceptionInterceptor exceptionInterceptor)
                                        throws SSLParamsException
        Configure the SSLContext based on the supplier property set.
        参数:
        clientCertificateKeyStore - clientCertificateKeyStore
        trustCertificateKeyStore - trustCertificateKeyStore
        fallbackToDefaultTrustStore - fallbackToDefaultTrustStore
        verifyServerCert - verifyServerCert
        hostName - host name
        exceptionInterceptor - exception interceptor
        返回:
        SSLContext
        抛出:
        SSLParamsException - if an error occurs
      • isSSLEstablished

        public static boolean isSSLEstablished​(Socket socket)