Mochiweb and SSL

Alessandro Sivieri <>
Tue Oct 26 12:15:06 CEST 2010


Hi all,

here again with a MochiWeb question: I'm trying to launch an instance of
MochiWeb with SSL support (which should be possible, for what I have found
on the Web about it); these are the options that I have added to
myserver_sup.erl:

WebConfig = [
         {ip, Ip},
                 {docroot, test_deps:local_path(["priv", "www"])},
                 {port, 443},
                 {ssl, true},
                 {ssl_opts, [
                    {certfile, "/somepath/certs/01.pem"},
                    {keyfile, "/somepath/private/01.key"},
                    {verify, verify_peer},
                    {cacertfile, "/somepath/cacert.pem"},
                    {fail_if_no_peer_cert, true},
                    {verify_fun, fun(_) -> false end}
                    ]}],

The three paths point to the CA certificate and to the certificate and key
created for the local server; Erlang R13 then crashes with the following:

http://pastebin.com/Mc8JvCgw

While Erlang R14 crashes with the following:

http://pastebin.com/4xnwkfU5

What should be the correct options to pass to the mochiweb_http:start()
function?

-- 
Sivieri Alessandro

http://www.chimera-bellerofonte.eu/
http://www.poul.org/


More information about the erlang-questions mailing list