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
a602718a
Commit
a602718a
authored
Mar 05, 2018
by
Guus der Kinderen
Committed by
akrherz
Mar 08, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OF-1501: Prefer NewSunX509 KeyManager implementation.
parent
2c3920de
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
2 deletions
+27
-2
IdentityStore.java
...ava/org/jivesoftware/openfire/keystore/IdentityStore.java
+14
-1
EncryptionArtifactFactory.java
.../jivesoftware/openfire/spi/EncryptionArtifactFactory.java
+13
-1
No files found.
src/java/org/jivesoftware/openfire/keystore/IdentityStore.java
View file @
a602718a
...
@@ -43,7 +43,20 @@ public class IdentityStore extends CertificateStore
...
@@ -43,7 +43,20 @@ public class IdentityStore extends CertificateStore
try
try
{
{
final
KeyManagerFactory
keyManagerFactory
=
KeyManagerFactory
.
getInstance
(
KeyManagerFactory
.
getDefaultAlgorithm
()
);
KeyManagerFactory
keyManagerFactory
;
try
{
// OF-1501: If multiple certificates are available, the 'NewSunX509' implementation in the SunJSSE
// provider makes the effort to pick a certificate with the appropriate key usage and prefers valid
// to expired certificates.
keyManagerFactory
=
KeyManagerFactory
.
getInstance
(
"NewSunX509"
);
}
catch
(
NoSuchAlgorithmException
e
)
{
Log
.
info
(
"Unable to load the 'NewSunX509' KeyManager implementation. Will fall back to the default."
);
keyManagerFactory
=
KeyManagerFactory
.
getInstance
(
KeyManagerFactory
.
getDefaultAlgorithm
()
);
}
keyManagerFactory
.
init
(
this
.
getStore
(),
configuration
.
getPassword
()
);
keyManagerFactory
.
init
(
this
.
getStore
(),
configuration
.
getPassword
()
);
}
}
catch
(
NoSuchAlgorithmException
|
UnrecoverableKeyException
|
KeyStoreException
ex
)
catch
(
NoSuchAlgorithmException
|
UnrecoverableKeyException
|
KeyStoreException
ex
)
...
...
src/java/org/jivesoftware/openfire/spi/EncryptionArtifactFactory.java
View file @
a602718a
...
@@ -53,7 +53,19 @@ public class EncryptionArtifactFactory
...
@@ -53,7 +53,19 @@ public class EncryptionArtifactFactory
{
{
if
(
keyManagerFactory
==
null
)
if
(
keyManagerFactory
==
null
)
{
{
try
{
// OF-1501: If multiple certificates are available, the 'NewSunX509' implementation in the SunJSSE
// provider makes the effort to pick a certificate with the appropriate key usage and prefers valid
// to expired certificates.
keyManagerFactory
=
KeyManagerFactory
.
getInstance
(
"NewSunX509"
);
}
catch
(
NoSuchAlgorithmException
e
)
{
Log
.
info
(
"Unable to load the 'NewSunX509' KeyManager implementation. Will fall back to the default."
);
keyManagerFactory
=
KeyManagerFactory
.
getInstance
(
KeyManagerFactory
.
getDefaultAlgorithm
()
);
keyManagerFactory
=
KeyManagerFactory
.
getInstance
(
KeyManagerFactory
.
getDefaultAlgorithm
()
);
}
keyManagerFactory
.
init
(
configuration
.
getIdentityStore
().
getStore
(),
configuration
.
getIdentityStoreConfiguration
().
getPassword
()
);
keyManagerFactory
.
init
(
configuration
.
getIdentityStore
().
getStore
(),
configuration
.
getIdentityStoreConfiguration
().
getPassword
()
);
}
}
...
...
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