object SSLContextFactory
- Source
- SSLContextFactory.scala
- Alphabetic
- By Inheritance
- SSLContextFactory
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
- def createSSLContextFromPem(certificatePath: Path, privateKeyPath: Path, trustedCaCertificatePaths: Optional[Seq[Path]], secureRandom: Optional[SecureRandom]): SSLContext
Convenience factory for constructing an SSLContext out of a certificate file, a private key file and possibly zero or more CA-certificate files to trust.
Convenience factory for constructing an SSLContext out of a certificate file, a private key file and possibly zero or more CA-certificate files to trust. All files must contain PEM encoded certificates or keys.
Note that the paths are filesystem paths, not class path, certificate files packaged in the JAR cannot be loaded using this method.
- certificatePath
Path to a PEM encoded certificate file
- privateKeyPath
Path to a PEM encoded key file
- trustedCaCertificatePaths
empty
Optional
to use the default system trust store, orOptional
with containing a list of one or more CA certificate paths to explicitly control exactly what CAs are trusted- secureRandom
a secure random to use for the SSL context or none to use a default instance API May Change
- Annotations
- @ApiMayChange()
- def createSSLContextFromPem(certificatePath: Path, privateKeyPath: Path, trustedCaCertificatePaths: List[Path]): SSLContext
Convenience factory for constructing an SSLContext out of a certificate file, a private key file and zero or more CA-certificate files.
Convenience factory for constructing an SSLContext out of a certificate file, a private key file and zero or more CA-certificate files. All files must contain PEM encoded certificates or keys.
Note that the paths are filesystem paths, not class path, certificate files packaged in the JAR cannot be loaded using this method.
API May Change
- Annotations
- @ApiMayChange()
- def createSSLContextFromPem(certificatePath: Path, privateKeyPath: Path): SSLContext
Convenience factory for constructing an SSLContext out of a certificate file, a private key file but use the default JDK trust store.
Convenience factory for constructing an SSLContext out of a certificate file, a private key file but use the default JDK trust store. All files must contain PEM encoded certificates or keys.
Note that the paths are filesystem paths, not class path, certificate files packaged in the JAR cannot be loaded using this method.
API May Change
- Annotations
- @ApiMayChange()
- def createSSLContextFromPem(config: Config): SSLContext
Convenience factory for constructing an SSLContext out of a certificate file, a private key file and zero or more CA-certificate files defined in config.
Convenience factory for constructing an SSLContext out of a certificate file, a private key file and zero or more CA-certificate files defined in config.
The provided
Config
is required to have the fieldcertificate
containing a path to a certificate file,private-key
containing the path to a private key, and the keytrusted-ca-certificates
either with the value "system" to use the default JDK truststore or containing a list of zero to many paths to CA certificate files to explicitly list what CA certs to trust. All files must contain PEM encoded certificates or keys.Note that the paths are filesystem paths, not class path, certificate files packaged in the JAR cannot be loaded using this method.
Example usage:
createSSLContextFromPem(system.settings.config.getConfig("my-server"))
API May Change
- Annotations
- @ApiMayChange()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def refreshingSSLContextProvider(refreshAfter: Duration)(construct: Creator[SSLContext]): Creator[SSLContext]
Keeps a created SSLContext around for a
refreshAfter
period, sharing it among connections, then creates a new context.Keeps a created SSLContext around for a
refreshAfter
period, sharing it among connections, then creates a new context. Actually constructing theSSLEngine
is left to caller, to allow additional customization of theSSLEngine
, for example to require client certificates in a server application.- refreshAfter
Keep a created context around this long, then recreate it
- construct
A factory method to create the context when recreating is needed
- returns
An SSLEngine provider function to use with Akka HTTP
ConnectionContext.httpsServer()
andConnectionContext.httpsClient
. API May Change
- Annotations
- @ApiMayChange()
- def refreshingSSLEngineProvider(refreshAfter: Duration)(construct: Creator[SSLContext]): Creator[SSLEngine]
Keeps a created SSLContext around for a
refreshAfter
period, sharing it among connections, then creates a new context.Keeps a created SSLContext around for a
refreshAfter
period, sharing it among connections, then creates a new context. Useful for rotating certificates.- refreshAfter
Keep a created context around this long, then recreate it
- construct
A factory method to create the context when recreating is needed
- returns
An SSLEngine provider function to use with Akka HTTP
ConnectionContext.httpsServer()
andConnectionContext.httpsClient
. API May Change
- Annotations
- @ApiMayChange()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])