我尝试编写一个使用 SSL 的简单 Happstack 应用程序。使用此源代码:
module Main where
import Happstack.Server( ok )
import Happstack.Server.SimpleHTTPS( TLSConf(..), nullTLSConf, simpleHTTPS )
conf :: TLSConf
conf = nullTLSConf{
tlsPort = 8011
, tlsCert = "server.crt"
, tlsKey = "server.key"
}
main :: IO ()
main = simpleHTTPS nullTLSConf $ ok "Hello, World!"
它编译,但是,当我作为普通用户运行时,我得到:
mytest: bind: permission denied (Permission denied)
当我以 root 运行时,我得到:
mytest: user error (error:02001002:system library:fopen:No such file or directory)
我做错了什么?
答案 0 :(得分:2)
我创建了错误:
应该是:
main = simpleHTTPS conf $ ok "Hello, World!"