amazon-web-services - Golang https 设置麻烦
问题描述
我在 AWS 上设置 https 时遇到问题:
我通过在我的服务器上使用 certbot 命令从letsencrypt获得证书:
./certbot-auto certonly --standalone -d go.minmacro.com --debug --agree-tos
我收到了成功消息:
恭喜!您的证书和链已保存在:
/etc/letsencrypt/live/go.minmacro.com/fullchain.pem
您的密钥文件已保存在:
/etc/letsencrypt/live/go.minmacro.com/privkey.pem
在我使用的 go 代码中:
err := http.ListenAndServeTLS(":443 ", "/etc/letsencrypt/live/go.minmacro.com/fullchain.pem", "/etc/letsencrypt/live/go.minmacro.com/privkey.pem", r)
fmt.Println(err)
当我运行这段代码时,会抛出一个错误:
监听 tcp:地址 tcp/443:未知端口
即使我已经将 https 添加到我的安全组
谁能给我一个建议?几天来我一直在与这个麻烦作斗争
解决方案
推荐阅读
- google-cloud-shell - GCP:如何确保在 Cloud Shell Editor 中设置了 gcp 项目
- r - 如何使用 get_elev_point 同时访问多个高程点
- mongodb - 具有重复键错误的 mongorestore 非常慢
- python - Django Whitenoise 导致收集静态错误
- asp.net-core - “dotnet new angular”应用程序中的脚手架身份出现错误
- android - 在 API 30 中为 resolveActivity 写入清单的意图操作
- react-native - 如何在本机反应中使用嵌套导航堆栈
- kubernetes - 如何使用 index.html 中的自定义文本在 nginx 上创建部署?
- json - 我如何能够比较两组 JSON 数据并检查一组是否在另一组中
- javascript - Async/Await:推理与实现