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
cc6be12e
Commit
cc6be12e
authored
Oct 22, 2015
by
Guus der Kinderen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OF-946: Use constant instead of hard-coded property name.
parent
fe97ecbe
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
270 additions
and
265 deletions
+270
-265
SSLConfigSocketFactory.java
...org/jivesoftware/openfire/net/SSLConfigSocketFactory.java
+3
-2
TLSWrapper.java
src/java/org/jivesoftware/openfire/net/TLSWrapper.java
+263
-262
SimpleSSLSocketFactory.java
src/java/org/jivesoftware/util/SimpleSSLSocketFactory.java
+4
-1
No files found.
src/java/org/jivesoftware/openfire/net/SSLConfigSocketFactory.java
View file @
cc6be12e
...
@@ -3,6 +3,7 @@ package org.jivesoftware.openfire.net;
...
@@ -3,6 +3,7 @@ package org.jivesoftware.openfire.net;
import
org.jivesoftware.openfire.keystore.IdentityStoreConfig
;
import
org.jivesoftware.openfire.keystore.IdentityStoreConfig
;
import
org.jivesoftware.openfire.keystore.Purpose
;
import
org.jivesoftware.openfire.keystore.Purpose
;
import
org.jivesoftware.openfire.keystore.TrustStoreConfig
;
import
org.jivesoftware.openfire.keystore.TrustStoreConfig
;
import
org.jivesoftware.openfire.session.ConnectionSettings
;
import
org.jivesoftware.util.CertificateEventListener
;
import
org.jivesoftware.util.CertificateEventListener
;
import
org.jivesoftware.util.CertificateManager
;
import
org.jivesoftware.util.CertificateManager
;
import
org.jivesoftware.util.JiveGlobals
;
import
org.jivesoftware.util.JiveGlobals
;
...
@@ -104,7 +105,7 @@ public class SSLConfigSocketFactory
...
@@ -104,7 +105,7 @@ public class SSLConfigSocketFactory
final
IdentityStoreConfig
identityStoreConfig
=
(
IdentityStoreConfig
)
SSLConfig
.
getInstance
().
getStoreConfig
(
Purpose
.
SOCKETBASED_IDENTITYSTORE
);
final
IdentityStoreConfig
identityStoreConfig
=
(
IdentityStoreConfig
)
SSLConfig
.
getInstance
().
getStoreConfig
(
Purpose
.
SOCKETBASED_IDENTITYSTORE
);
final
TrustStoreConfig
trustStoreConfig
=
(
TrustStoreConfig
)
SSLConfig
.
getInstance
().
getStoreConfig
(
Purpose
.
SOCKETBASED_C2S_TRUSTSTORE
);
final
TrustStoreConfig
trustStoreConfig
=
(
TrustStoreConfig
)
SSLConfig
.
getInstance
().
getStoreConfig
(
Purpose
.
SOCKETBASED_C2S_TRUSTSTORE
);
final
String
algorithm
=
JiveGlobals
.
getProperty
(
"xmpp.socket.ssl.algorithm"
,
"TLS"
);
final
String
algorithm
=
JiveGlobals
.
getProperty
(
ConnectionSettings
.
Client
.
TLS_ALGORITHM
,
"TLS"
);
final
SSLContext
context
=
SSLContext
.
getInstance
(
algorithm
);
final
SSLContext
context
=
SSLContext
.
getInstance
(
algorithm
);
context
.
init
(
identityStoreConfig
.
getKeyManagers
(),
trustStoreConfig
.
getTrustManagers
(),
new
java
.
security
.
SecureRandom
()
);
context
.
init
(
identityStoreConfig
.
getKeyManagers
(),
trustStoreConfig
.
getTrustManagers
(),
new
java
.
security
.
SecureRandom
()
);
...
@@ -116,7 +117,7 @@ public class SSLConfigSocketFactory
...
@@ -116,7 +117,7 @@ public class SSLConfigSocketFactory
final
IdentityStoreConfig
identityStoreConfig
=
(
IdentityStoreConfig
)
SSLConfig
.
getInstance
().
getStoreConfig
(
Purpose
.
SOCKETBASED_IDENTITYSTORE
);
final
IdentityStoreConfig
identityStoreConfig
=
(
IdentityStoreConfig
)
SSLConfig
.
getInstance
().
getStoreConfig
(
Purpose
.
SOCKETBASED_IDENTITYSTORE
);
final
TrustStoreConfig
trustStoreConfig
=
(
TrustStoreConfig
)
SSLConfig
.
getInstance
().
getStoreConfig
(
Purpose
.
SOCKETBASED_S2S_TRUSTSTORE
);
final
TrustStoreConfig
trustStoreConfig
=
(
TrustStoreConfig
)
SSLConfig
.
getInstance
().
getStoreConfig
(
Purpose
.
SOCKETBASED_S2S_TRUSTSTORE
);
final
String
algorithm
=
JiveGlobals
.
getProperty
(
"xmpp.socket.ssl.algorithm"
,
"TLS"
);
final
String
algorithm
=
JiveGlobals
.
getProperty
(
ConnectionSettings
.
Client
.
TLS_ALGORITHM
,
"TLS"
);
final
SSLContext
context
=
SSLContext
.
getInstance
(
algorithm
);
final
SSLContext
context
=
SSLContext
.
getInstance
(
algorithm
);
context
.
init
(
identityStoreConfig
.
getKeyManagers
(),
trustStoreConfig
.
getTrustManagers
(),
new
java
.
security
.
SecureRandom
()
);
context
.
init
(
identityStoreConfig
.
getKeyManagers
(),
trustStoreConfig
.
getTrustManagers
(),
new
java
.
security
.
SecureRandom
()
);
...
...
src/java/org/jivesoftware/openfire/net/TLSWrapper.java
View file @
cc6be12e
...
@@ -36,6 +36,7 @@ import org.jivesoftware.openfire.Connection;
...
@@ -36,6 +36,7 @@ import org.jivesoftware.openfire.Connection;
import
org.jivesoftware.openfire.keystore.IdentityStoreConfig
;
import
org.jivesoftware.openfire.keystore.IdentityStoreConfig
;
import
org.jivesoftware.openfire.keystore.Purpose
;
import
org.jivesoftware.openfire.keystore.Purpose
;
import
org.jivesoftware.openfire.keystore.TrustStoreConfig
;
import
org.jivesoftware.openfire.keystore.TrustStoreConfig
;
import
org.jivesoftware.openfire.session.ConnectionSettings
;
import
org.jivesoftware.util.JiveGlobals
;
import
org.jivesoftware.util.JiveGlobals
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -96,7 +97,7 @@ public class TLSWrapper {
...
@@ -96,7 +97,7 @@ public class TLSWrapper {
}
}
final
IdentityStoreConfig
identityStoreConfig
=
(
IdentityStoreConfig
)
sslConfig
.
getStoreConfig
(
Purpose
.
SOCKETBASED_IDENTITYSTORE
);
final
IdentityStoreConfig
identityStoreConfig
=
(
IdentityStoreConfig
)
sslConfig
.
getStoreConfig
(
Purpose
.
SOCKETBASED_IDENTITYSTORE
);
final
String
algorithm
=
JiveGlobals
.
getProperty
(
"xmpp.socket.ssl.algorithm"
,
"TLS"
);
final
String
algorithm
=
JiveGlobals
.
getProperty
(
ConnectionSettings
.
Client
.
TLS_ALGORITHM
,
"TLS"
);
final
SSLContext
tlsContext
=
SSLContext
.
getInstance
(
algorithm
);
final
SSLContext
tlsContext
=
SSLContext
.
getInstance
(
algorithm
);
tlsContext
.
init
(
identityStoreConfig
.
getKeyManagers
(),
tm
,
null
);
tlsContext
.
init
(
identityStoreConfig
.
getKeyManagers
(),
tm
,
null
);
...
...
src/java/org/jivesoftware/util/SimpleSSLSocketFactory.java
View file @
cc6be12e
...
@@ -37,8 +37,11 @@ import java.security.cert.CertificateException;
...
@@ -37,8 +37,11 @@ import java.security.cert.CertificateException;
import
java.security.cert.CertificateExpiredException
;
import
java.security.cert.CertificateExpiredException
;
import
java.security.cert.CertificateNotYetValidException
;
import
java.security.cert.CertificateNotYetValidException
;
import
java.security.cert.X509Certificate
;
import
java.security.cert.X509Certificate
;
import
java.util.Comparator
;
import
java.util.Comparator
;
import
org.jivesoftware.openfire.session.ConnectionSettings
;
/**
/**
* SSLSocketFactory that accepts any certificate chain and also accepts expired
* SSLSocketFactory that accepts any certificate chain and also accepts expired
* certificates.
* certificates.
...
@@ -54,7 +57,7 @@ public class SimpleSSLSocketFactory extends SSLSocketFactory implements Comparat
...
@@ -54,7 +57,7 @@ public class SimpleSSLSocketFactory extends SSLSocketFactory implements Comparat
public
SimpleSSLSocketFactory
()
{
public
SimpleSSLSocketFactory
()
{
try
{
try
{
String
algorithm
=
JiveGlobals
.
getProperty
(
"xmpp.socket.ssl.algorithm"
,
"TLS"
);
String
algorithm
=
JiveGlobals
.
getProperty
(
ConnectionSettings
.
Client
.
TLS_ALGORITHM
,
"TLS"
);
SSLContext
sslcontent
=
SSLContext
.
getInstance
(
algorithm
);
SSLContext
sslcontent
=
SSLContext
.
getInstance
(
algorithm
);
sslcontent
.
init
(
null
,
// KeyManager not required
sslcontent
.
init
(
null
,
// KeyManager not required
new
TrustManager
[]
{
new
DummyTrustManager
()
},
new
TrustManager
[]
{
new
DummyTrustManager
()
},
...
...
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