perwendel / spark

A simple expressive web framework for java. Spark has a kotlin DSL https://github.com/perwendel/spark-kotlin
Apache License 2.0
9.63k stars 1.56k forks source link

If secure(..) used and path to cert is wrong or empty, SparkJava exits without error #1185

Closed whughes98144 closed 3 years ago

whughes98144 commented 3 years ago

I had the secure(...) call working with an installed https cert that was stupidly placed in /tmp. Then rebooted (clearing /tmp) and the webserver would no longer start up. Would install the routes however and then just exit with rc 0. No errors.

Eventually figured it out (commented the 'secure (...)' call out) and then realized the problem: i was pointing to a non-existent keystore. Whoops. But no error?

Isn't there some way we could get a meaningful error on this?

whughes98144 commented 3 years ago

Huh, running the secure test from the sparkjava src, if you put in an incorrect path, you get a nice error. I'm coding in kotlin, and have used both the java and kotlin version of sparkjava and still see the issue. Still investigating... I've got a trust store as well, though not sure if that'd have any affect.

whughes98144 commented 3 years ago

I gotta think this is something on the Kotlin end, probably that I'm missing, that's swallowing the error. Will reopen if I can find a repro I can post