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
da6a8e86
Commit
da6a8e86
authored
Apr 23, 2018
by
Madhura Bhave
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.0.x'
parents
60bf4ef4
877c4f70
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
SslConnectorCustomizer.java
...work/boot/web/embedded/tomcat/SslConnectorCustomizer.java
+1
-0
SslConnectorCustomizerTests.java
...boot/web/embedded/tomcat/SslConnectorCustomizerTests.java
+16
-0
No files found.
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/SslConnectorCustomizer.java
View file @
da6a8e86
...
...
@@ -113,6 +113,7 @@ class SslConnectorCustomizer implements TomcatConnectorCustomizer {
new
SslStoreProviderUrlStreamHandlerFactory
(
sslStoreProvider
));
try
{
if
(
sslStoreProvider
.
getKeyStore
()
!=
null
)
{
protocol
.
setKeystorePass
(
""
);
protocol
.
setKeystoreFile
(
SslStoreProviderUrlStreamHandlerFactory
.
KEY_STORE_URL
);
}
if
(
sslStoreProvider
.
getTrustStore
()
!=
null
)
{
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/SslConnectorCustomizerTests.java
View file @
da6a8e86
...
...
@@ -24,6 +24,7 @@ import java.security.KeyStoreException;
import
java.security.NoSuchAlgorithmException
;
import
java.security.cert.CertificateException
;
import
org.apache.catalina.LifecycleState
;
import
org.apache.catalina.connector.Connector
;
import
org.apache.catalina.startup.Tomcat
;
import
org.apache.catalina.webresources.TomcatURLStreamHandlerFactory
;
...
...
@@ -154,6 +155,21 @@ public class SslConnectorCustomizerTests {
assertThat
(
sslHostConfig
.
getCertificateKeystoreFile
()).
contains
(
sslHostConfigWithDefaults
.
getCertificateKeystoreFile
());
}
@Test
public
void
customizeWhenSslStoreProviderPresentShouldIgnorePasswordFromSsl
()
throws
Exception
{
Ssl
ssl
=
new
Ssl
();
ssl
.
setKeyPassword
(
"password"
);
ssl
.
setKeyStorePassword
(
"secret"
);
SslStoreProvider
sslStoreProvider
=
mock
(
SslStoreProvider
.
class
);
given
(
sslStoreProvider
.
getTrustStore
()).
willReturn
(
loadStore
());
given
(
sslStoreProvider
.
getKeyStore
()).
willReturn
(
loadStore
());
SslConnectorCustomizer
customizer
=
new
SslConnectorCustomizer
(
ssl
,
sslStoreProvider
);
Connector
connector
=
this
.
tomcat
.
getConnector
();
customizer
.
customize
(
connector
);
this
.
tomcat
.
start
();
assertThat
(
connector
.
getState
()).
isEqualTo
(
LifecycleState
.
STARTED
);
}
private
KeyStore
loadStore
()
throws
KeyStoreException
,
IOException
,
NoSuchAlgorithmException
,
CertificateException
{
KeyStore
keyStore
=
KeyStore
.
getInstance
(
"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