0

在我的 linode 盒子上,我安装了 Let's Encrypt SSL 证书并创建了一个简单的 Vibe.d 应用程序来测试我的 SSL 连接。我总是超时。这是代码:

import vibe.vibe;

void main()
{
        auto settings = new HTTPServerSettings;
        settings.port = 8080;
        settings.bindAddresses = ["::1", "127.0.0.1","50.116.15.145"];
        settings.tlsContext = createTLSContext(TLSContextKind.server);
        settings.tlsContext.useCertificateChainFile("/etc/letsencrypt/live/findyourtutor.info/cert.pem");
        settings.tlsContext.usePrivateKeyFile("/etc/letsencrypt/live/findyourtutor.info/privkey.pem");
        listenHTTP(settings, &hello);

        logInfo("Please open 'http://www.findyourtutor.info' in your browser.");
        runApplication();
}

void hello(HTTPServerRequest req, HTTPServerResponse res)
{
        res.writeBody("Hello, World!");
}

如果我只是访问

www.findyourtutor.info or
findyourtutor.info

我可以很好地查看它们。

但如果我访问https://findyourtutor.info,我会超时。

我也超时

https://findyourtutor.info:8080
https://www.findyourtutor.info
https://www.findyourtutor.info:8080

在 linode 登录时,我可以做

lynx https://localhost:8080

并且 lynx 会警告我有关证书的信息,但按两次“y”后我可以看到该站点。

我也可以

lynx http://localhost

但不是

lynx http://localhost:8080

在这一点上,我不知道是我的代码有问题还是我的设置有问题。

我的 UFW 防火墙允许来自任何地方的 HTTPS。

4

1 回答 1

2

我会使用 nginx 作为 vibe-d 应用程序的代理,这比尝试将 vibed 与 ssl 一起使用要好。

但你的设置似乎真的很奇怪。www.findyourtutor.info您正在侦听 8080,因此无论是否以某种方式指定端口,都应该无法访问您的站点 findyourtutor.info,所以我猜还有其他一些 Web 服务器正在运行。443如果你想使用,你应该试着听https。或者你已经有一些代理?

于 2017-02-13T18:05:31.570 回答