Skip to content
Permalink
Browse files

Hook up PEM file support.

If ssl.source is set to "pem", then SSL materiel will be loaded
from the files specified in ssl.certificatefile and ssl.privatekeyfile.

ssl.source defaults to "keystore", but any other unknown value
will also fallback to "keystore".

Issue #108
  • Loading branch information...
csmith authored and ShaneMcC committed Apr 23, 2017
1 parent 02d6233 commit de231b91774f6f9512fc04478a0a593ff6a48b61
Showing with 14 additions and 2 deletions.
  1. +1 −1 modules/sockets
  2. +3 −0 res/com/dfbnc/defaults.config
  3. +10 −1 src/com/dfbnc/DFBnc.java
@@ -70,6 +70,9 @@ irc:
lastKnownChannels=

ssl:
source=keystore
storepass=
keypass=
keystore=
certificatefile=
privatekeyfile=
@@ -386,7 +386,16 @@ public void openListenSockets() {
final List<String> listenhosts = config.getOptionList("general", "listenhost");

if (sslContextManager == null) {
sslContextManager = new SSLContextManager(getConfig().getOption("ssl", "keystore"), getConfig().getOption("ssl", "storepass"), getConfig().getOption("ssl", "keypass"));
if ("pem".equalsIgnoreCase(getConfig().getOption("ssl", "source"))) {
sslContextManager = new SSLContextManager(
getConfig().getOption("ssl", "certificatefile"),
getConfig().getOption("ssl", "privatekeyfile"));
} else {
sslContextManager = new SSLContextManager(
getConfig().getOption("ssl", "keystore"),
getConfig().getOption("ssl", "storepass"),
getConfig().getOption("ssl", "keypass"));
}
}

for (String listenhost : listenhosts) {

0 comments on commit de231b9

Please sign in to comment.
You can’t perform that action at this time.