Formatting
This commit is contained in:
parent
35ea86c6ac
commit
8a098d81ca
|
@ -39,7 +39,7 @@ import javax.crypto.CipherOutputStream
|
||||||
import javax.crypto.spec.SecretKeySpec
|
import javax.crypto.spec.SecretKeySpec
|
||||||
|
|
||||||
private val LOGGER = LoggerFactory.getLogger("Application")
|
private val LOGGER = LoggerFactory.getLogger("Application")
|
||||||
private val THREADS_TO_ALLOCATE = Runtime.getRuntime().availableProcessors() * 30 / 2 ;
|
private val THREADS_TO_ALLOCATE = Runtime.getRuntime().availableProcessors() * 30 / 2
|
||||||
|
|
||||||
fun getServer(cache: DiskLruCache, serverSettings: ServerSettings, clientSettings: ClientSettings, statistics: AtomicReference<Statistics>): Http4kServer {
|
fun getServer(cache: DiskLruCache, serverSettings: ServerSettings, clientSettings: ClientSettings, statistics: AtomicReference<Statistics>): Http4kServer {
|
||||||
val executor = Executors.newCachedThreadPool()
|
val executor = Executors.newCachedThreadPool()
|
||||||
|
|
|
@ -21,13 +21,9 @@
|
||||||
//SOFTWARE.
|
//SOFTWARE.
|
||||||
package mdnet.base
|
package mdnet.base
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream
|
|
||||||
import java.io.ByteArrayOutputStream
|
import java.io.ByteArrayOutputStream
|
||||||
import java.io.InputStream
|
|
||||||
import java.security.KeyFactory
|
import java.security.KeyFactory
|
||||||
import java.security.PrivateKey
|
import java.security.PrivateKey
|
||||||
import java.security.cert.CertificateFactory
|
|
||||||
import java.security.cert.X509Certificate
|
|
||||||
import java.security.spec.InvalidKeySpecException
|
import java.security.spec.InvalidKeySpecException
|
||||||
import java.security.spec.PKCS8EncodedKeySpec
|
import java.security.spec.PKCS8EncodedKeySpec
|
||||||
|
|
||||||
|
|
|
@ -98,10 +98,10 @@ class Netty(private val tls: ServerSettings.TlsCert, private val clientSettings:
|
||||||
counter.resetCumulativeTime()
|
counter.resetCumulativeTime()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private val limiter = ConnectionCounter();
|
private val limiter = ConnectionCounter()
|
||||||
|
|
||||||
override fun start(): Http4kServer = apply {
|
override fun start(): Http4kServer = apply {
|
||||||
val (mainCert, chainCert) = getX509Certs(tls.certificate);
|
val (mainCert, chainCert) = getX509Certs(tls.certificate)
|
||||||
val sslContext = SslContextBuilder
|
val sslContext = SslContextBuilder
|
||||||
.forServer(getPrivateKey(tls.privateKey), mainCert, chainCert)
|
.forServer(getPrivateKey(tls.privateKey), mainCert, chainCert)
|
||||||
.protocols("TLSv1.3", "TLSv.1.2", "TLSv.1.1", "TLSv.1.0")
|
.protocols("TLSv1.3", "TLSv.1.2", "TLSv.1.1", "TLSv.1.0")
|
||||||
|
|
Loading…
Reference in a new issue