0
在我的linode盒子上,我安裝了Let's Encrypt SSL證書並創建了一個裸機Vibe.d應用程序來測試我的SSL連接。我總是超時。下面是代碼:Vibe.d上的HTTPS
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
和山貓提醒我有關的證書,但按「Y」後,我可以看到網站兩次。
我還可以做
lynx http://localhost
但不
lynx http://localhost:8080
在這一點上,我不知道如果我的代碼是錯誤的或我的設置是錯誤的。
我的UFW防火牆允許從任何地方使用HTTPS。
感謝您的回答,@ Kozzi11。是的,它似乎很奇怪,但它以某種方式起作用。我會嘗試你的建議。 –
Hi @ Kozzi11,我發現我的程序在發出ps aux後有多個實例,其中一個在80端口監聽!所以我重新啓動了我的linode,現在一切都更清晰了。 –