Formatting

This commit is contained in:
carbotaniuman 2020-06-09 14:21:29 -05:00
parent 35ea86c6ac
commit 8a098d81ca
3 changed files with 4 additions and 8 deletions

View file

@ -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()

View file

@ -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

View file

@ -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")