Package org.mariadb.jdbc.plugin.tls.main
Class DefaultTlsSocketPlugin
- java.lang.Object
-
- org.mariadb.jdbc.plugin.tls.main.DefaultTlsSocketPlugin
-
- All Implemented Interfaces:
TlsSocketPlugin
public class DefaultTlsSocketPlugin extends java.lang.Object implements TlsSocketPlugin
Default TLS socket plugin
-
-
Constructor Summary
Constructors Constructor Description DefaultTlsSocketPlugin()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.io.InputStream
getInputStreamFromPath(java.lang.String path)
javax.net.ssl.KeyManager[]
getKeyManager(Configuration conf, ExceptionFactory exceptionFactory)
javax.net.ssl.TrustManager[]
getTrustManager(Configuration conf, ExceptionFactory exceptionFactory, HostAddress hostAddress)
private static javax.net.ssl.KeyManager
loadClientCerts(java.lang.String keyStoreUrl, java.lang.String keyStorePassword, java.lang.String keyPassword, java.lang.String storeType, ExceptionFactory exceptionFactory)
private static java.io.InputStream
loadFromUrl(java.lang.String keyStoreUrl)
java.lang.String
type()
plugin type.void
verify(java.lang.String host, javax.net.ssl.SSLSession session, long serverThreadId)
Host name verifier implementation.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.mariadb.jdbc.plugin.TlsSocketPlugin
createSocket
-
-
-
-
Field Detail
-
logger
private static final Logger logger
-
-
Method Detail
-
loadClientCerts
private static javax.net.ssl.KeyManager loadClientCerts(java.lang.String keyStoreUrl, java.lang.String keyStorePassword, java.lang.String keyPassword, java.lang.String storeType, ExceptionFactory exceptionFactory) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
loadFromUrl
private static java.io.InputStream loadFromUrl(java.lang.String keyStoreUrl) throws java.io.FileNotFoundException
- Throws:
java.io.FileNotFoundException
-
getInputStreamFromPath
private static java.io.InputStream getInputStreamFromPath(java.lang.String path) throws java.io.IOException
- Throws:
java.io.IOException
-
type
public java.lang.String type()
Description copied from interface:TlsSocketPlugin
plugin type.- Specified by:
type
in interfaceTlsSocketPlugin
- Returns:
- plugin type
-
getTrustManager
public javax.net.ssl.TrustManager[] getTrustManager(Configuration conf, ExceptionFactory exceptionFactory, HostAddress hostAddress) throws java.sql.SQLException
- Specified by:
getTrustManager
in interfaceTlsSocketPlugin
- Throws:
java.sql.SQLException
-
getKeyManager
public javax.net.ssl.KeyManager[] getKeyManager(Configuration conf, ExceptionFactory exceptionFactory) throws java.sql.SQLException
- Specified by:
getKeyManager
in interfaceTlsSocketPlugin
- Throws:
java.sql.SQLException
-
verify
public void verify(java.lang.String host, javax.net.ssl.SSLSession session, long serverThreadId) throws javax.net.ssl.SSLException
Description copied from interface:TlsSocketPlugin
Host name verifier implementation.- Specified by:
verify
in interfaceTlsSocketPlugin
- Parameters:
host
- hostnamesession
- ssl sessionserverThreadId
- current server threadId- Throws:
javax.net.ssl.SSLException
- if verification fail
-
-