curl - 保险柜无法连接超时
问题描述
我有一个 Hasicorp Vault 服务器正在运行,当我使用下面的命令在本地对其进行 curl 请求时,我收到一个错误(如下)。
当我运行该命令curl -H "X-Vault-Token: $VAULT_TOKEN" $VAULT_ADDR/v1/secret/keys
时,它在保管库服务器上运行良好,但是当我从笔记本电脑执行此命令时,它给了我错误。
两者$VAULT_TOKEN
和$VAULT_ADDR
都在本地机器上正确设置。
错误
curl: (7) Failed to connect to example.com port 8200: Operation timed out
/etc/vault.hcl
backend "file" {
path = "/var/lib/vault"
scheme = "http"
redirect_addr = "http://example.com:8200"
VAULT_ADDR = "http://example.com:8200"
}
listener "tcp" {
address = "0.0.0.0:8200"
tls_disable = 0
tls_cert_file = "/etc/letsencrypt/live/example.com/fullchain.pem"
tls_key_file = "/etc/letsencrypt/live/example.com/privkey.pem"
}
解决方案
问题最终与保管库没有任何关系,而是与8200
Azure 上阻止的端口有关的防火墙问题。
推荐阅读
- sql - 在python中执行时简单SQL出错
- mysql - 如何在mysql中添加随机限制
- java - 如何为发布请求编写模拟测试
- javascript - 如何使用一行 .js 代码触发文件下载(不需要用户与 HTML 交互)
- scala - 使用默认值从 Map 列获取值
- javascript - 使用 JavaScript 更改模糊滤镜
- php - 为什么我无法更新 codeigniter 中的记录?
- java - JavaFX 将 TextField 的 TextFormatter 中的 valueProperty 绑定到 SimpleDoubleProperty
- c# - 问题陈述 - 无法理解问题的措辞
- java - 我们什么时候使用类变量,而不是使用类的对象?