mirror of
https://gitlab.com/mangadex-pub/mangadex_at_home.git
synced 2024-01-19 02:48:37 +00:00
Formatting
This commit is contained in:
parent
35ea86c6ac
commit
8a098d81ca
|
@ -39,7 +39,7 @@ import javax.crypto.CipherOutputStream
|
|||
import javax.crypto.spec.SecretKeySpec
|
||||
|
||||
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 {
|
||||
val executor = Executors.newCachedThreadPool()
|
||||
|
|
|
@ -21,13 +21,9 @@
|
|||
//SOFTWARE.
|
||||
package mdnet.base
|
||||
|
||||
import java.io.ByteArrayInputStream
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.io.InputStream
|
||||
import java.security.KeyFactory
|
||||
import java.security.PrivateKey
|
||||
import java.security.cert.CertificateFactory
|
||||
import java.security.cert.X509Certificate
|
||||
import java.security.spec.InvalidKeySpecException
|
||||
import java.security.spec.PKCS8EncodedKeySpec
|
||||
|
||||
|
|
|
@ -98,10 +98,10 @@ class Netty(private val tls: ServerSettings.TlsCert, private val clientSettings:
|
|||
counter.resetCumulativeTime()
|
||||
}
|
||||
}
|
||||
private val limiter = ConnectionCounter();
|
||||
private val limiter = ConnectionCounter()
|
||||
|
||||
override fun start(): Http4kServer = apply {
|
||||
val (mainCert, chainCert) = getX509Certs(tls.certificate);
|
||||
val (mainCert, chainCert) = getX509Certs(tls.certificate)
|
||||
val sslContext = SslContextBuilder
|
||||
.forServer(getPrivateKey(tls.privateKey), mainCert, chainCert)
|
||||
.protocols("TLSv1.3", "TLSv.1.2", "TLSv.1.1", "TLSv.1.0")
|
||||
|
@ -164,4 +164,4 @@ fun getX509Certs(certificates: String): Pair<X509Certificate, X509Certificate> {
|
|||
|
||||
fun getPrivateKey(privateKey: String): PrivateKey {
|
||||
return loadKey(privateKey)!!
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue