Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Openfire
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Openfire
Commits
c4773fd9
Commit
c4773fd9
authored
Nov 28, 2015
by
Guus der Kinderen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Configuration representation should not include factory methods.
parent
3c1a4efd
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
344 additions
and
296 deletions
+344
-296
AdminConsolePlugin.java
...g/jivesoftware/openfire/container/AdminConsolePlugin.java
+2
-2
HttpBindManager.java
src/java/org/jivesoftware/openfire/http/HttpBindManager.java
+2
-1
TLSWrapper.java
src/java/org/jivesoftware/openfire/net/TLSWrapper.java
+4
-2
NIOConnection.java
src/java/org/jivesoftware/openfire/nio/NIOConnection.java
+4
-2
ConnectionAcceptor.java
...ava/org/jivesoftware/openfire/spi/ConnectionAcceptor.java
+4
-1
ConnectionConfiguration.java
...rg/jivesoftware/openfire/spi/ConnectionConfiguration.java
+0
-288
EncryptionArtifactFactory.java
.../jivesoftware/openfire/spi/EncryptionArtifactFactory.java
+328
-0
No files found.
src/java/org/jivesoftware/openfire/container/AdminConsolePlugin.java
View file @
c4773fd9
...
...
@@ -47,11 +47,11 @@ import org.eclipse.jetty.util.thread.QueuedThreadPool;
import
org.eclipse.jetty.webapp.WebAppContext
;
import
org.jivesoftware.openfire.JMXManager
;
import
org.jivesoftware.openfire.XMPPServer
;
import
org.jivesoftware.openfire.keystore.CertificateStoreManager
;
import
org.jivesoftware.openfire.keystore.IdentityStore
;
import
org.jivesoftware.openfire.spi.ConnectionConfiguration
;
import
org.jivesoftware.openfire.spi.ConnectionManagerImpl
;
import
org.jivesoftware.openfire.spi.ConnectionType
;
import
org.jivesoftware.openfire.spi.EncryptionArtifactFactory
;
import
org.jivesoftware.util.CertificateEventListener
;
import
org.jivesoftware.util.CertificateManager
;
import
org.jivesoftware.util.JiveGlobals
;
...
...
@@ -157,7 +157,7 @@ public class AdminConsolePlugin implements Plugin {
final
ConnectionManagerImpl
connectionManager
=
(
(
ConnectionManagerImpl
)
XMPPServer
.
getInstance
().
getConnectionManager
()
);
final
ConnectionConfiguration
configuration
=
connectionManager
.
getConfiguration
(
ConnectionType
.
WEBADMIN
,
true
);
final
SslContextFactory
sslContextFactory
=
configuration
.
getSslContextFactory
();
final
SslContextFactory
sslContextFactory
=
new
EncryptionArtifactFactory
(
configuration
)
.
getSslContextFactory
();
final
ServerConnector
httpsConnector
;
if
(
"npn"
.
equals
(
JiveGlobals
.
getXMLProperty
(
"spdy.protocol"
,
""
)
)
)
...
...
src/java/org/jivesoftware/openfire/http/HttpBindManager.java
View file @
c4773fd9
...
...
@@ -64,6 +64,7 @@ import org.jivesoftware.openfire.session.ConnectionSettings;
import
org.jivesoftware.openfire.spi.ConnectionConfiguration
;
import
org.jivesoftware.openfire.spi.ConnectionManagerImpl
;
import
org.jivesoftware.openfire.spi.ConnectionType
;
import
org.jivesoftware.openfire.spi.EncryptionArtifactFactory
;
import
org.jivesoftware.util.CertificateEventListener
;
import
org.jivesoftware.util.CertificateManager
;
import
org.jivesoftware.util.JiveGlobals
;
...
...
@@ -258,7 +259,7 @@ public final class HttpBindManager {
final
ConnectionManagerImpl
connectionManager
=
((
ConnectionManagerImpl
)
XMPPServer
.
getInstance
().
getConnectionManager
());
final
ConnectionConfiguration
configuration
=
connectionManager
.
getConfiguration
(
ConnectionType
.
BOSH_C2S
,
true
);
final
SslContextFactory
sslContextFactory
=
configuration
.
getSslContextFactory
();
final
SslContextFactory
sslContextFactory
=
new
EncryptionArtifactFactory
(
configuration
)
.
getSslContextFactory
();
final
HttpConfiguration
httpsConfig
=
new
HttpConfiguration
();
httpsConfig
.
setSecureScheme
(
"https"
);
...
...
src/java/org/jivesoftware/openfire/net/TLSWrapper.java
View file @
c4773fd9
...
...
@@ -33,6 +33,7 @@ import javax.net.ssl.SSLEngineResult.Status;
import
org.jivesoftware.openfire.Connection
;
import
org.jivesoftware.openfire.spi.ConnectionConfiguration
;
import
org.jivesoftware.openfire.spi.ConnectionType
;
import
org.jivesoftware.openfire.spi.EncryptionArtifactFactory
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -75,14 +76,15 @@ public class TLSWrapper {
try
{
final
EncryptionArtifactFactory
factory
=
new
EncryptionArtifactFactory
(
configuration
);
final
SSLEngine
sslEngine
;
if
(
clientMode
)
{
sslEngine
=
configuration
.
createClientModeSSLEngine
();
sslEngine
=
factory
.
createClientModeSSLEngine
();
}
else
{
sslEngine
=
configuration
.
createServerModeSSLEngine
();
sslEngine
=
factory
.
createServerModeSSLEngine
();
}
final
SSLSession
sslSession
=
sslEngine
.
getSession
();
...
...
src/java/org/jivesoftware/openfire/nio/NIOConnection.java
View file @
c4773fd9
...
...
@@ -54,6 +54,7 @@ import org.jivesoftware.openfire.session.LocalSession;
import
org.jivesoftware.openfire.session.Session
;
import
org.jivesoftware.openfire.spi.ConnectionConfiguration
;
import
org.jivesoftware.openfire.spi.ConnectionType
;
import
org.jivesoftware.openfire.spi.EncryptionArtifactFactory
;
import
org.jivesoftware.util.XMLWriter
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -373,14 +374,15 @@ public class NIOConnection implements Connection {
public
void
startTLS
(
boolean
clientMode
)
throws
Exception
{
final
EncryptionArtifactFactory
factory
=
new
EncryptionArtifactFactory
(
configuration
);
final
SslFilter
filter
;
if
(
clientMode
)
{
filter
=
configuration
.
createClientModeSslFilter
();
filter
=
factory
.
createClientModeSslFilter
();
}
else
{
filter
=
configuration
.
createServerModeSslFilter
();
filter
=
factory
.
createServerModeSslFilter
();
}
ioSession
.
getFilterChain
().
addBefore
(
EXECUTOR_FILTER_NAME
,
TLS_FILTER_NAME
,
filter
);
...
...
src/java/org/jivesoftware/openfire/spi/ConnectionAcceptor.java
View file @
c4773fd9
...
...
@@ -48,6 +48,8 @@ class ConnectionAcceptor
// Configuration
private
final
ConnectionConfiguration
configuration
;
private
final
EncryptionArtifactFactory
encryptionArtifactFactory
;
private
NioSocketAcceptor
socketAcceptor
;
/**
...
...
@@ -61,6 +63,7 @@ class ConnectionAcceptor
}
this
.
configuration
=
configuration
;
this
.
encryptionArtifactFactory
=
new
EncryptionArtifactFactory
(
configuration
);
this
.
name
=
configuration
.
getType
().
toString
().
toLowerCase
()
+
(
configuration
.
getTlsPolicy
()
==
Connection
.
TLSPolicy
.
legacyMode
?
"_ssl"
:
""
);
Log
=
LoggerFactory
.
getLogger
(
ConnectionAcceptor
.
class
.
getName
()
+
"["
+
name
+
"]"
);
...
...
@@ -132,7 +135,7 @@ class ConnectionAcceptor
// Ports can be configured to start connections in SSL (as opposed to upgrade a non-encrypted socket to an encrypted one, typically using StartTLS)
if
(
configuration
.
getTlsPolicy
()
==
Connection
.
TLSPolicy
.
legacyMode
)
{
final
SslFilter
sslFilter
=
configuration
.
createServerModeSslFilter
();
final
SslFilter
sslFilter
=
encryptionArtifactFactory
.
createServerModeSslFilter
();
filterChain
.
addAfter
(
ConnectionManagerImpl
.
EXECUTOR_FILTER_NAME
,
ConnectionManagerImpl
.
TLS_FILTER_NAME
,
sslFilter
);
}
...
...
src/java/org/jivesoftware/openfire/spi/ConnectionConfiguration.java
View file @
c4773fd9
This diff is collapsed.
Click to expand it.
src/java/org/jivesoftware/openfire/spi/EncryptionArtifactFactory.java
0 → 100644
View file @
c4773fd9
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment