Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
dataplatform
atlas
Commits
fd24e652
Commit
fd24e652
authored
Oct 14, 2020
by
nixonrodrigues
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3995 : Atlas should support additional keystore/truststores types besides JKS.
parent
39892854
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
SecurityProperties.java
...in/java/org/apache/atlas/security/SecurityProperties.java
+2
-0
SecureEmbeddedServer.java
...va/org/apache/atlas/web/service/SecureEmbeddedServer.java
+6
-2
No files found.
intg/src/main/java/org/apache/atlas/security/SecurityProperties.java
View file @
fd24e652
...
...
@@ -32,9 +32,11 @@ public final class SecurityProperties {
public
static
final
String
KEYSTORE_FILE_KEY
=
"keystore.file"
;
public
static
final
String
DEFAULT_KEYSTORE_FILE_LOCATION
=
"target/atlas.keystore"
;
public
static
final
String
KEYSTORE_PASSWORD_KEY
=
"keystore.password"
;
public
static
final
String
KEYSTORE_TYPE
=
"keystore.type"
;
public
static
final
String
TRUSTSTORE_FILE_KEY
=
"truststore.file"
;
public
static
final
String
DEFATULT_TRUSTORE_FILE_LOCATION
=
"target/atlas.keystore"
;
public
static
final
String
TRUSTSTORE_PASSWORD_KEY
=
"truststore.password"
;
public
static
final
String
TRUSTSTORE_TYPE
=
"truststore.type"
;
public
static
final
String
SERVER_CERT_PASSWORD_KEY
=
"password"
;
public
static
final
String
CLIENT_AUTH_KEY
=
"client.auth.enabled"
;
public
static
final
String
CERT_STORES_CREDENTIAL_PROVIDER_PATH
=
"cert.stores.credential.provider.path"
;
...
...
webapp/src/main/java/org/apache/atlas/web/service/SecureEmbeddedServer.java
View file @
fd24e652
...
...
@@ -69,6 +69,8 @@ import static org.apache.atlas.security.SecurityProperties.TRUSTSTORE_FILE_KEY;
import
static
org
.
apache
.
atlas
.
security
.
SecurityProperties
.
TRUSTSTORE_PASSWORD_KEY
;
import
static
org
.
apache
.
atlas
.
security
.
SecurityProperties
.
ATLAS_SSL_EXCLUDE_PROTOCOLS
;
import
static
org
.
apache
.
atlas
.
security
.
SecurityProperties
.
DEFAULT_EXCLUDE_PROTOCOLS
;
import
static
org
.
apache
.
atlas
.
security
.
SecurityProperties
.
KEYSTORE_TYPE
;
import
static
org
.
apache
.
atlas
.
security
.
SecurityProperties
.
TRUSTSTORE_TYPE
;
import
static
org
.
apache
.
atlas
.
security
.
SecurityUtil
.
getPassword
;
...
...
@@ -101,10 +103,12 @@ public class SecureEmbeddedServer extends EmbeddedServer {
}
SslContextFactory
sslContextFactory
=
new
SslContextFactory
();
sslContextFactory
.
setKeyStoreType
(
config
.
getString
(
KEYSTORE_TYPE
,
ATLAS_KEYSTORE_FILE_TYPE_DEFAULT
));
sslContextFactory
.
setKeyStorePath
(
config
.
getString
(
KEYSTORE_FILE_KEY
,
System
.
getProperty
(
KEYSTORE_FILE_KEY
,
DEFAULT_KEYSTORE_FILE_LOCATION
)));
sslContextFactory
.
setKeyStorePassword
(
getPassword
(
config
,
KEYSTORE_PASSWORD_KEY
));
sslContextFactory
.
setKeyManagerPassword
(
getPassword
(
config
,
SERVER_CERT_PASSWORD_KEY
));
sslContextFactory
.
setTrustStoreType
(
config
.
getString
(
TRUSTSTORE_TYPE
,
ATLAS_TRUSTSTORE_FILE_TYPE_DEFAULT
));
sslContextFactory
.
setTrustStorePath
(
config
.
getString
(
TRUSTSTORE_FILE_KEY
,
System
.
getProperty
(
TRUSTSTORE_FILE_KEY
,
DEFATULT_TRUSTORE_FILE_LOCATION
)));
sslContextFactory
.
setTrustStorePassword
(
getPassword
(
config
,
TRUSTSTORE_PASSWORD_KEY
));
...
...
@@ -198,7 +202,7 @@ public class SecureEmbeddedServer extends EmbeddedServer {
in
=
getFileInputStream
(
keyStoreFile
);
if
(
in
!=
null
)
{
KeyStore
keyStore
=
KeyStore
.
getInstance
(
ATLAS_KEYSTORE_FILE_TYPE_DEFAULT
);
KeyStore
keyStore
=
KeyStore
.
getInstance
(
getConfiguration
().
getString
(
KEYSTORE_TYPE
,
ATLAS_KEYSTORE_FILE_TYPE_DEFAULT
)
);
keyStore
.
load
(
in
,
keyStoreFilepwd
.
toCharArray
());
...
...
@@ -251,7 +255,7 @@ public class SecureEmbeddedServer extends EmbeddedServer {
in
=
getFileInputStream
(
truststoreFile
);
if
(
in
!=
null
)
{
KeyStore
trustStore
=
KeyStore
.
getInstance
(
ATLAS_TRUSTSTORE_FILE_TYPE_DEFAULT
);
KeyStore
trustStore
=
KeyStore
.
getInstance
(
getConfiguration
().
getString
(
TRUSTSTORE_TYPE
,
ATLAS_TRUSTSTORE_FILE_TYPE_DEFAULT
)
);
trustStore
.
load
(
in
,
trustStoreFilepwd
.
toCharArray
());
...
...
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