Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
user-manager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OZG-Cloud
app
user-manager
Commits
39a35ff3
Commit
39a35ff3
authored
1 year ago
by
OZGCloud
Browse files
Options
Downloads
Patches
Plain Diff
OZG-3322 init trust manager factory
parent
d722ac58
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
user-manager-server/src/main/java/de/itvsh/kop/user/MongodbCertificateLoader.java
+4
-1
4 additions, 1 deletion
...main/java/de/itvsh/kop/user/MongodbCertificateLoader.java
with
4 additions
and
1 deletion
user-manager-server/src/main/java/de/itvsh/kop/user/MongodbCertificateLoader.java
+
4
−
1
View file @
39a35ff3
...
...
@@ -14,6 +14,7 @@ import java.security.cert.CertificateFactory;
import
javax.enterprise.context.ApplicationScoped
;
import
javax.enterprise.event.Observes
;
import
javax.net.ssl.TrustManagerFactory
;
import
org.apache.commons.io.IOUtils
;
import
org.eclipse.microprofile.config.inject.ConfigProperty
;
...
...
@@ -43,6 +44,8 @@ class MongodbCertificateLoader {
try
{
var
trustStore
=
initKeyStore
();
trustStore
.
setCertificateEntry
(
"ca"
,
generateCertificate
());
TrustManagerFactory
tmf
=
TrustManagerFactory
.
getInstance
(
TrustManagerFactory
.
getDefaultAlgorithm
());
tmf
.
init
(
trustStore
);
return
trustStore
;
}
catch
(
Exception
e
)
{
throw
new
TechnicalException
(
"Error building KeyStore"
,
e
);
...
...
@@ -52,7 +55,7 @@ class MongodbCertificateLoader {
KeyStore
initKeyStore
()
{
try
{
var
trustStore
=
KeyStore
.
getInstance
(
"pkcs12"
);
trustStore
.
load
(
null
,
null
);
trustStore
.
load
(
null
);
return
trustStore
;
}
catch
(
Exception
e
)
{
throw
new
TechnicalException
(
"Error init KeyStore"
,
e
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment