I have a weird error.
I have some images lying in a folder on my server in /media/uploads
I then served these images over a Spring Boot application with this Controller:
@GetMapping("/image/{name}") fun getImage(@PathVariable name: String): ResponseEntity<Resource> { val path = Paths.get("$PATH/$name") val resource = UrlResource(path.toUri()) return ResponseEntity.ok().contentType(MediaType.IMAGE_JPEG).body(resource) }
When using this over http I have no problems at all, but as soon as I enable SSL this endpoint stops working, which means the /image endpoint is not reachable at all over https. All other sites seem to work except they don't load these images.
My application.properties if this helps:
server.port=443server.ssl.key-store=/root/foto/certificate.pfxserver.ssl.key-store-password=***server.ssl.keyStoreType=PKCS12
I already tried:
- still serving the images over http (but http requests inside https sites get blocked)
- serving both http and https
Any ideas would be appreciated