mirror of
https://git.krews.org/morningstar/nitrowebsockets-for-ms
synced 2024-11-22 23:10:52 +01:00
added logging to certificate loader
This commit is contained in:
parent
6d7a52dbad
commit
79c1502635
@ -2,17 +2,21 @@ package org.krews.plugin.nitro.websockets.ssl;
|
|||||||
|
|
||||||
import io.netty.handler.ssl.SslContext;
|
import io.netty.handler.ssl.SslContext;
|
||||||
import io.netty.handler.ssl.SslContextBuilder;
|
import io.netty.handler.ssl.SslContextBuilder;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
public class SSLCertificateLoader {
|
public class SSLCertificateLoader {
|
||||||
private static final String filePath = "ssl";
|
private static final String filePath = "ssl";
|
||||||
|
private static final Logger LOGGER = LoggerFactory.getLogger(SSLCertificateLoader.class);
|
||||||
|
|
||||||
public static SslContext getContext() {
|
public static SslContext getContext() {
|
||||||
SslContext context;
|
SslContext context;
|
||||||
try {
|
try {
|
||||||
context = SslContextBuilder.forServer(new File( filePath + File.separator + "cert.pem" ), new File( filePath + File.separator + "privkey.pem" )).build();
|
context = SslContextBuilder.forServer(new File( filePath + File.separator + "cert.pem" ), new File( filePath + File.separator + "privkey.pem" )).build();
|
||||||
} catch ( Exception e ) {
|
} catch ( Exception e ) {
|
||||||
|
LOGGER.info("Unable to load ssl: " + e.getMessage());
|
||||||
context = null;
|
context = null;
|
||||||
}
|
}
|
||||||
return context;
|
return context;
|
||||||
|
Loading…
Reference in New Issue
Block a user