0

Using JavaSpark framework, and a known-good Keystore.jks on the server, the basic secure() command fails as shown below.

Any suggestions?

Thanks,

$curl -k https://testsite.com:4567/secureHello

ERROR: curl: (35) Unknown SSL protocol error in connection to testsite.com:-9847

Morkus
  • 517
  • 7
  • 21
  • How are you using the secure method? – Pablo Matias Gomez Jul 24 '17 at 15:05
  • get("/secureHello", (req, res) -> { secure("/PATH_TO_KEYSTORE_FILE/keystore.jks", "thePassword", "", ""); return "\nHello, secureHello.\n\n" ; }); – Morkus Jul 25 '17 at 16:16
  • That's not how you should use it. You should call that method before the `get` declaration.. check this: https://stackoverflow.com/a/36843005/3645944 – Pablo Matias Gomez Jul 25 '17 at 18:55
  • Possible duplicate of [Use https in spark-java](https://stackoverflow.com/questions/21084527/use-https-in-spark-java) – Pablo Matias Gomez Jul 25 '17 at 18:55
  • OK, thanks. Excellent. I missed that. However, now I have another problem. When I try to start the service, like this: $ java -jar ./service.jar, say from the desktop directory (where the JAR file is), I now get an error when Spark tries to start that the "Desktop" is a directory and the service doesn't start. I have a full path to the JKS file so I'm confused what's happening. If I comment out the secure setup above the first GET, then I can start the service successfully like before. – Morkus Jul 26 '17 at 19:21

0 Answers0