Hi Team,
I have created the config server with self-signed certificate. Now I am trying to connect config client (spring boot applicaiton in my local machine) but getting below exception
2016-09-08 14:11:39.270 WARN [csapi,,,] 7448 --- [ restartedMain] c.c.c.ConfigServicePropertySourceLocator : Could not locate PropertySource: I/O error on GET request for "https://localhost:9443/testapi/dev": java.security.cert.CertificateException: No name matching localhost found; nested exception is javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No name matching localhost found
Is there any way to overcome this issue in my local machine?
Thanks in advance.
Comment From: ryanjbaxter
Sounds like the certificate CN does not match the hostname, in this case localhost
. You probably want to double check that your self-signed certificate is using the right CN and if not recreate it.
This article might be of some help: http://java.globinch.com/enterprise-java/security/fix-java-security-certificate-exception-no-matching-localhost-found/
Comment From: okelet
Although this issue has been closed, i have one question. Will a client be able to connect to a config server using a self-signed certificate? Is the only requirement to match the CN in the self-signed certificate?
Comment From: ryanjbaxter
Yes, you might need to customize the RestTemplate
though
https://docs.spring.io/spring-cloud-config/docs/current/reference/html/#custom-rest-template