Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
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
DEMO
spring-boot
Commits
006d4bc3
Commit
006d4bc3
authored
Nov 05, 2020
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not set Tomcat's trust store password when null
See gh-24041
parent
2425dcd2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
SslConnectorCustomizer.java
...work/boot/web/embedded/tomcat/SslConnectorCustomizer.java
+3
-1
SslConnectorCustomizerTests.java
...boot/web/embedded/tomcat/SslConnectorCustomizerTests.java
+11
-0
No files found.
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/SslConnectorCustomizer.java
View file @
006d4bc3
...
@@ -148,7 +148,9 @@ class SslConnectorCustomizer implements TomcatConnectorCustomizer {
...
@@ -148,7 +148,9 @@ class SslConnectorCustomizer implements TomcatConnectorCustomizer {
throw
new
WebServerException
(
"Could not load trust store: "
+
ex
.
getMessage
(),
ex
);
throw
new
WebServerException
(
"Could not load trust store: "
+
ex
.
getMessage
(),
ex
);
}
}
}
}
protocol
.
setTruststorePass
(
ssl
.
getTrustStorePassword
());
if
(
ssl
.
getTrustStorePassword
()
!=
null
)
{
protocol
.
setTruststorePass
(
ssl
.
getTrustStorePassword
());
}
if
(
ssl
.
getTrustStoreType
()
!=
null
)
{
if
(
ssl
.
getTrustStoreType
()
!=
null
)
{
protocol
.
setTruststoreType
(
ssl
.
getTrustStoreType
());
protocol
.
setTruststoreType
(
ssl
.
getTrustStoreType
());
}
}
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/SslConnectorCustomizerTests.java
View file @
006d4bc3
...
@@ -206,6 +206,17 @@ class SslConnectorCustomizerTests {
...
@@ -206,6 +206,17 @@ class SslConnectorCustomizerTests {
assertThat
(
protocol
.
getKeyPass
()).
isEqualTo
(
"password"
);
assertThat
(
protocol
.
getKeyPass
()).
isEqualTo
(
"password"
);
}
}
@Test
void
trustStorePasswordIsNotSetWhenNull
()
{
Http11NioProtocol
protocol
=
(
Http11NioProtocol
)
this
.
tomcat
.
getConnector
().
getProtocolHandler
();
protocol
.
setTruststorePass
(
"password"
);
Ssl
ssl
=
new
Ssl
();
ssl
.
setKeyStore
(
"src/test/resources/test.jks"
);
ssl
.
setTrustStore
(
"src/test/resources/test.jks"
);
new
SslConnectorCustomizer
(
ssl
,
null
).
customize
(
this
.
tomcat
.
getConnector
());
assertThat
(
protocol
.
getTruststorePass
()).
isEqualTo
(
"password"
);
}
private
KeyStore
loadStore
()
throws
KeyStoreException
,
IOException
,
NoSuchAlgorithmException
,
CertificateException
{
private
KeyStore
loadStore
()
throws
KeyStoreException
,
IOException
,
NoSuchAlgorithmException
,
CertificateException
{
KeyStore
keyStore
=
KeyStore
.
getInstance
(
"JKS"
);
KeyStore
keyStore
=
KeyStore
.
getInstance
(
"JKS"
);
Resource
resource
=
new
ClassPathResource
(
"test.jks"
);
Resource
resource
=
new
ClassPathResource
(
"test.jks"
);
...
...
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