Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
asset-distribution
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
data-spider
asset-distribution
Commits
ad08fb3a
Commit
ad08fb3a
authored
Apr 23, 2020
by
liwenbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
f
parent
fee8f209
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
HttpClientConfig.java
...roup/asset/distribution/config/http/HttpClientConfig.java
+4
-4
No files found.
src/main/java/com/quantgroup/asset/distribution/config/http/HttpClientConfig.java
View file @
ad08fb3a
...
...
@@ -42,8 +42,8 @@ import java.security.cert.X509Certificate;
@Configuration
public
class
HttpClientConfig
{
@Value
(
"${
niwodai.online
}"
)
private
Boolean
is
OnLine
;
@Value
(
"${
isDebug
}"
)
private
Boolean
is
Debug
;
@Bean
(
name
=
"httpClient"
)
public
CloseableHttpClient
httpClient
()
throws
NoSuchAlgorithmException
,
KeyManagementException
{
...
...
@@ -129,9 +129,9 @@ public class HttpClientConfig {
};
String
classesPath
=
"/niwodai"
;
KeyStore
keyStore
=
KeyStore
.
getInstance
(
"JKS"
);
keyStore
.
load
(
HttpClientConfig
.
class
.
getResourceAsStream
(
classesPath
+
"/qg-keystore"
+
(
is
OnLine
?
""
:
"-test
"
)
+
".jks"
),
"password"
.
toCharArray
());
keyStore
.
load
(
HttpClientConfig
.
class
.
getResourceAsStream
(
classesPath
+
"/qg-keystore"
+
(
is
Debug
?
"-test"
:
"
"
)
+
".jks"
),
"password"
.
toCharArray
());
KeyStore
trustStore
=
KeyStore
.
getInstance
(
"JKS"
);
trustStore
.
load
(
HttpClientConfig
.
class
.
getResourceAsStream
(
classesPath
+
"/qg-truststore"
+
(
is
OnLine
?
""
:
"-test
"
)
+
".jks"
),
"password"
.
toCharArray
());
trustStore
.
load
(
HttpClientConfig
.
class
.
getResourceAsStream
(
classesPath
+
"/qg-truststore"
+
(
is
Debug
?
"-test"
:
"
"
)
+
".jks"
),
"password"
.
toCharArray
());
SSLContext
sslcontext
=
SSLContexts
.
custom
()
.
loadTrustMaterial
(
trustStore
,
new
TrustSelfSignedStrategy
())
.
loadKeyMaterial
(
keyStore
,
"password"
.
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