pedestal

simongray 2020-11-02T14:19:10.088300Z

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…?

2020-11-02T14:19:45.088700Z

Running locally?

simongray 2020-11-02T14:19:47.088900Z

yes

2020-11-02T14:20:17.089500Z

The process doesn’t have permissions to run on port 443

simongray 2020-11-02T14:20:47.090Z

changing the :ssl-port to literally anything gives me the same exception (edit: anything below 1024 I guess)

2020-11-02T14:20:57.090300Z

hrm

2020-11-02T14:21:23.091Z

ports less than 1024 require root perms

💡 1
simongray 2020-11-02T14:23:15.091500Z

aha!

simongray 2020-11-02T14:23:51.091900Z

Thanks @ddeaguiar I didn’t know that 🙂

2020-11-02T14:25:33.092300Z

np!