SSl Tutorial application access issue
**Hi I have taken guidance to implement the code from: https://www.baeldung.com/spring-boot-https-self-signed-certificate
and have built two different applications in spring boot, one that exposes the endpoint and another is trying to connect it and retrieve the data but while testing I am getting an error, please give me a guide to resolve the issue**
2022-07-06 23:57:41.583 INFO 14928 --- [ restartedMain] com.spring.rest.RestApplication : Starting RestApplication using Java 11.0.14 on Prashant-X360 with PID 14928 (E:\PROJECTS\GitHub\spring-restTemplate\target\classes started by hp in E:\PROJECTS\GitHub\spring-restTemplate) 2022-07-06 23:57:41.583 INFO 14928 --- [ restartedMain] com.spring.rest.RestApplication : No active profile set, falling back to 1 default profile: "default" 2022-07-06 23:57:41.646 INFO 14928 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable 2022-07-06 23:57:42.963 INFO 14928 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729 2022-07-06 23:57:42.991 INFO 14928 --- [ restartedMain] com.spring.rest.RestApplication : Started RestApplication in 1.993 seconds (JVM running for 3.411) 2022-07-06 23:57:43.314 WARN 14928 --- [ scheduling-1] com.spring.rest.service.RestService : I/O error on GET request for "https://192.168.1.9:8080/employee": Certificate for <192.168.1.9> doesn't match any of the subject alternative names: []; nested exception is javax.net.ssl.SSLPeerUnverifiedException: Certificate for <192.168.1.9> doesn't match any of the subject alternative names: [] 2022-07-06 23:57:43.320 ERROR 14928 --- [ scheduling-1] o.s.s.s.TaskUtils$LoggingErrorHandler : Unexpected error occurred in scheduled task
java.lang.NullPointerException: null at com.spring.rest.controller.RestController.executeSchedule(RestController.java:36) ~[classes/:na] at com.spring.rest.controller.RestController.runSchedule(RestController.java:29) ~[classes/:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na] at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) ~[spring-context-5.3.21.jar:5.3.21] at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-5.3.21.jar:5.3.21] at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[na:na] at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) ~[na:na] at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[na:na] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na] at java.base/java.lang.Thread.run(Thread.java:834) ~[na:an]
Hi,
Most probably this StackOverflow thread should help you: https://stackoverflow.com/questions/50928061/certificate-for-localhost-doesnt-match-any-of-the-subject-alternative-names
Anyway, we'll double check the article and maybe update it so that it's clear how to test it locally.