Fork me on GitHub
#pedestal
<
2020-11-02
>
simongray14:11:10

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.
     ;; 
     ::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  (Net.java:-2).
Permission denied 
what am I missing here…?

ddeaguiar14:11:45

Running locally?

ddeaguiar14:11:17

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

simongray14:11:47

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

ddeaguiar14:11:23

ports less than 1024 require root perms

💡 1
simongray14:11:51

Thanks @ddeaguiar I didn’t know that 🙂