Package com.linkedin.venice.utils
Class SslUtils
java.lang.Object
com.linkedin.venice.utils.SslUtils
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThis class is used to configure TLS for Venice components in integration tests. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetPathForResource(String resource) This function should be used in test cases only.static SSLFactorygetSSLFactory(Properties sslProperties, String factoryClassName) A helper function that return an instance ofSSLFactorywith ssl Properties.static SSLFactoryThis function should be used in test cases only.static PropertiesThis function should be used in test cases only.static X509CertificategetX509Certificate(Certificate certificate) static booleanCheck whether openssl provider is available or not.static PropertiesloadSSLConfig(String configFilePath) Build an instance ofPropertieswith a file path to SSL config file.static SSLEngineFactoryImpl.ConfigtoAlpiniSSLConfig(SSLConfig sslConfig) static SslFactorytoAlpiniSSLFactory(SSLFactory sslFactory) static SslFactorytoAlpiniSSLFactory(SSLFactory sslFactory, boolean openssl) static SSLFactorytoSSLFactoryWithOpenSSLSupport(SSLFactory sslFactory) Adapt the incomingSSLFactoryinto a new one backed by openssl if it is available.
-
Field Details
-
LOCAL_PASSWORD
Self-signed cert. Use keystore as truststore since self-signed. Cert has CN=localhost IMPORTANT NOTE: the "localhost.jks", "localhost.cert", "localhost.key" and "localhost.p12" files only exist in the code base; do not try to load this files in actual hosts- See Also:
-
LOCAL_KEYSTORE_JKS
- See Also:
-
-
Constructor Details
-
SslUtils
public SslUtils()
-
-
Method Details
-
getVeniceLocalSslFactory
This function should be used in test cases only.- Returns:
- a local SSL factory that uses a self-signed development certificate.
-
getVeniceLocalSslProperties
This function should be used in test cases only.- Returns:
- an instance of
Propertiesthat contains local SSL configs.
-
getTlsConfiguration
-
getPathForResource
This function should be used in test cases only.- Parameters:
resource- -- System resource name- Returns:
- the path to the local key store location
-
toAlpiniSSLFactory
-
toAlpiniSSLFactory
-
toSSLFactoryWithOpenSSLSupport
Adapt the incomingSSLFactoryinto a new one backed by openssl if it is available. -
isConscryptAvailable
public static boolean isConscryptAvailable()Check whether openssl provider is available or not. -
toAlpiniSSLConfig
-
getSSLFactory
A helper function that return an instance ofSSLFactorywith ssl Properties.- Parameters:
sslProperties-factoryClassName- Different products can plug-in different factory classes.
-
loadSSLConfig
Build an instance ofPropertieswith a file path to SSL config file. An example of SSL config file: ssl.enabled:true ssl.key.password:local_password ssl.keystore.location:./identity.p12 ssl.keystore.password:local_password ssl.keystore.type:pkcs12 ssl.truststore.location:./cacerts ssl.truststore.password:local_password- Throws:
IOException
-
getX509Certificate
-