Skip to content
This repository has been archived by the owner on Jul 27, 2019. It is now read-only.

Commit

Permalink
Fix TLS support.
Browse files Browse the repository at this point in the history
  • Loading branch information
cnaude committed Mar 20, 2015
1 parent e1adcc1 commit 983b667
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -81,7 +81,7 @@
<dependency>
<groupId>com.cnaude.pircbotx</groupId>
<artifactId>pircbotx</artifactId>
<version>2.0.4</version>
<version>2.0.5</version>
</dependency>

<!-- Needed for PircBotX -->
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/cnaude/purpleirc/PurpleBot.java
Expand Up @@ -261,7 +261,10 @@ public void buildBot() {
plugin.logInfo("Setting IdentPassword ...");
configBuilder.setNickservPassword(botIdentPassword);
}
if (ssl || tls) {
if (tls) {
plugin.logInfo("Enabling TLS ...");
configBuilder.addCapHandler(new TLSCapHandler());
} else if (ssl) {
UtilSSLSocketFactory socketFactory = new UtilSSLSocketFactory();
socketFactory.disableDiffieHellman();
if (trustAllCerts) {
Expand All @@ -271,9 +274,6 @@ public void buildBot() {
plugin.logInfo("Enabling SSL ...");
}
configBuilder.setSocketFactory(socketFactory);
if (tls) {
configBuilder.addCapHandler(new TLSCapHandler(socketFactory, true));
}
}
if (charSet.isEmpty()) {
plugin.logInfo("Using default character set: " + Charset.defaultCharset());
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/SampleBot.yml
Expand Up @@ -17,10 +17,10 @@ realname: ''
server: irc.excample.com
# port - IRC server port
port: 6667
# Enable TLS support via STARTTLS. Must connect to non-SSL port to use this.
tls: false
# Attempt ssl connection to IRC server
ssl: false
# Enable TLS support
tls: false
# Trust all SSL certs
trust-all-certs: false
# Bind address
Expand Down

0 comments on commit 983b667

Please sign in to comment.