在我的 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。