I have a project that uses Spring Integration for TCP connections.
After this I used keystore and truststore files in my project like this:
<bean id="sslContextSupport" class="org.springframework.integration.ip.tcp.connection.DefaultTcpSSLContextSupport">
<constructor-arg value="file:C:\Program Files\Java\jdk-11.0.6\bin\produced.keystore"/>
<constructor-arg value="file:C:\Program Files\Java\jdk-11.0.6\bin\producedTrustStore"/>
<constructor-arg value="TEST1234"/>
<constructor-arg value="TEST1234"/>
</bean>
<int-ip:tcp-connection-factory ...
ssl-context-support="sslContextSupport"
.../>
When I send a request with this config, I'm getting
SSLHandshakeException:sun.security.validator.ValidatorException: No trusted certificate found:No trusted certificate found
How can I solve this problem?
Run with -Djavax.net.debug=all
to debug TLS/SSL problems.
Have you imported the server's cert into the trust store?
See this test case and its comments.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.