我试图编写一个简单的使用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)
我做错了什么?
我发现了错误:
它应该是:
main = simpleHTTPS conf $ ok "Hello, World!"