在我的linode机器上,我安装了让我们加密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:8080lynx会警告我证书的问题,但我可以在按两次'y‘键后看到站点。
我也可以做
lynx http://localhost但不是
lynx http://localhost:8080在这一点上,我不知道是我的代码出错还是我的设置出错。
我的UFW防火墙允许来自任何地方的HTTPS。
发布于 2017-02-14 02:05:32
我会使用nginx作为你的vibe-d应用的代理,这比尝试使用带有ssl的vibed要好。
但是你的设置看起来真的很奇怪。您正在监听8080,所以在没有指定端口的情况下,应该无法使用www.findyourtutor.info或findyourtutor.info访问您的站点,所以我猜还有一些其他的web服务器在起作用。如果你想使用https,你应该尝试在443上进行监听。或者你已经有一些代理了吗?
https://stackoverflow.com/questions/42209455
复制相似问题