I don’t understand how to get https working and I can’t find any sample code. My understanding is that this is a minimal configuration:
(def service-map
(let [home (System/getProperty "user.home")
jks (str home "/_certifiable_certs/localhost-1d070e4/dev-server.jks")]
{::http/routes routes
::http/type :jetty
::http/port 8890
;; Development-only keystore created using Bruce Hauman's Certifiable.
;; <https://github.com/bhauman/certifiable#quick-start-command-line-usage>
::http/container-options {:ssl? true
:ssl-port 443
:keystore jks
:key-password "password"}}))
but attempting to start the server using this service map results in
Execution error (BindException) at <http://sun.nio.ch.Net/bind0|sun.nio.ch.Net/bind0> (Net.java:-2).
Permission denied
what am I missing here…?Running locally?
yes
The process doesn’t have permissions to run on port 443
changing the :ssl-port to literally anything gives me the same exception (edit: anything below 1024 I guess)
hrm
ports less than 1024 require root perms
aha!
Thanks @ddeaguiar I didn’t know that 🙂
np!