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
ad128319
Commit
ad128319
authored
May 29, 2018
by
Madhura Bhave
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix test in "Truststore password if SSLstoreprovider present"
See gh-13088
parent
e75d45ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
SslConnectorCustomizerTests.java
...boot/web/embedded/tomcat/SslConnectorCustomizerTests.java
+8
-1
No files found.
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/SslConnectorCustomizerTests.java
View file @
ad128319
...
...
@@ -31,8 +31,10 @@ import org.apache.catalina.webresources.TomcatURLStreamHandlerFactory;
import
org.apache.tomcat.util.net.SSLHostConfig
;
import
org.junit.After
;
import
org.junit.Before
;
import
org.junit.Rule
;
import
org.junit.Test
;
import
org.springframework.boot.testsupport.rule.OutputCapture
;
import
org.springframework.boot.web.server.Ssl
;
import
org.springframework.boot.web.server.SslStoreProvider
;
import
org.springframework.core.io.ClassPathResource
;
...
...
@@ -54,6 +56,9 @@ public class SslConnectorCustomizerTests {
private
Connector
connector
;
@Rule
public
OutputCapture
output
=
new
OutputCapture
();
@Before
public
void
setup
()
{
this
.
tomcat
=
new
Tomcat
();
...
...
@@ -64,6 +69,7 @@ public class SslConnectorCustomizerTests {
@After
public
void
stop
()
throws
Exception
{
System
.
clearProperty
(
"javax.net.ssl.trustStorePassword"
);
ReflectionTestUtils
.
setField
(
TomcatURLStreamHandlerFactory
.
class
,
"instance"
,
null
);
ReflectionTestUtils
.
setField
(
URL
.
class
,
"factory"
,
null
);
...
...
@@ -167,10 +173,10 @@ public class SslConnectorCustomizerTests {
@Test
public
void
customizeWhenSslStoreProviderPresentShouldIgnorePasswordFromSsl
()
throws
Exception
{
System
.
setProperty
(
"javax.net.ssl.trustStorePassword"
,
"trustStoreSecret"
);
Ssl
ssl
=
new
Ssl
();
ssl
.
setKeyPassword
(
"password"
);
ssl
.
setKeyStorePassword
(
"secret"
);
ssl
.
setTrustStorePassword
(
"trustStoreSecret"
);
SslStoreProvider
sslStoreProvider
=
mock
(
SslStoreProvider
.
class
);
given
(
sslStoreProvider
.
getTrustStore
()).
willReturn
(
loadStore
());
given
(
sslStoreProvider
.
getKeyStore
()).
willReturn
(
loadStore
());
...
...
@@ -180,6 +186,7 @@ public class SslConnectorCustomizerTests {
customizer
.
customize
(
connector
);
this
.
tomcat
.
start
();
assertThat
(
connector
.
getState
()).
isEqualTo
(
LifecycleState
.
STARTED
);
assertThat
(
this
.
output
.
toString
()).
doesNotContain
(
"Password verification failed"
);
}
private
KeyStore
loadStore
()
throws
KeyStoreException
,
IOException
,
...
...
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