0

我试图编写一个使用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)

我做错了什么?

4

1 回答 1

2

我发现了错误:

它应该是:

main = simpleHTTPS conf $ ok "Hello, World!"
于 2013-01-31T11:41:59.943 回答