I use define-easy-handler all the time. I now have a freshly minted ssl certificate and associated pem files, but can't figure out what the ssl equivalent of d-e-h is.
For example, I have:
(hunchentoot:define-easy-handler
(login :uri "/login")
()
(login-html))
which is just a simple form whose formaction goes here:
(hunchentoot:define-easy-handler
(dologin :uri "/dologin")
(email password)
(dologin-html email password))
I got the required .pem
files from freecert, so I think that I have the files that go to :SSL-CERTIFICATE-FILE and :SSL-PRIVATEKEY-FILE. I've tried various args to the above to make this work, but can't seem to get it to work. Can someone give me an example of how to do this?
Thanks in advance for you help!
This is not a function of the handlers but of the acceptor. All you need to do is use an
easy-ssl-acceptor
instead of aneasy-acceptor
for starting your server:You can keep your easy-handlers and change the type of acceptor you need.
For tests, if you don't already have a self-signed certificate , you can do:
Then, we define two kinds of acceptors:
Start them:
Your browser should complain the first time you try to access HTTPS pages (ignore the security exception).
Note also that the
:acceptor-names
argument is optional (thanks @Simeon Ikudabo), here above it was added explictly for the examples. You can just define an SSL acceptor and let all your pages be served over a secure link.