problem: used slow JDK TLS

This commit is contained in:
Igor Artamonov
2020-05-24 13:03:00 -04:00
committed by GitHub
parent 4a698f8c09
commit 47eb126a75
3 changed files with 14 additions and 2 deletions

View File

@@ -21,6 +21,7 @@ import io.grpc.netty.GrpcSslContexts
import io.netty.handler.ssl.ClientAuth
import io.netty.handler.ssl.SslContext
import io.netty.handler.ssl.SslContextBuilder
import io.netty.handler.ssl.SslProvider
import org.apache.commons.lang3.StringUtils
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Autowired
@@ -61,6 +62,10 @@ class TlsSetup(
}
if (mustBeSecure || (!tlsDisabled && hasServerCertificate)) {
log.info("Using TLS for $category")
if (SslContext.defaultServerProvider() == SslProvider.JDK) {
log.warn("Using JDK TLS implementation. Install OpenSSL to better performance")
}
val sslContextBuilder = if (grpc) {
GrpcSslContexts.forServer(
fileResolver.resolve(config.certificate!!),