具有 Azure 证书身份验证的 Azure VPN 网关

时间:2020-12-21 22:19:30

标签: azure ssl vpn azure-vpn

我正在关注有关使用 Azure 证书身份验证类型和 IKEv2 设置 Azure VPN 网关的文档。我目前使用 Hashicorp 的 Vault 进行 PKI 管理。我已经生成了一个中间 CA,它将根据我们的根证书颁发机构颁发适当的证书,其中包含 Azure 所需的扩展密钥用法。

# Create the VPN intermediate.
vault secrets enable -path=pki-vpn pki

# Set the TTL
vault secrets tune -max-lease-ttl=43800h pki-vpn

# Generate the CSR.
vault write -format=json pki-vpn/intermediate/generate/internal \
        common_name="AzureRoot" \
        | jq -r '.data.csr' > pki-vpn-intermediate.csr

# Get the signed public certificate.
vault write -format=json pki/root/sign-intermediate csr=@pki-vpn-intermediate.csr \
        format=pem_bundle ttl="43800h" \
        | jq -r '.data.certificate' > intermediate-vpn.crt

# Upload the signed certificate to back to the intermediate.
vault write pki-vpn/intermediate/set-signed certificate=@intermediate-vpn.crt

# Create an issuing role, specifically for client authentication.
vault write pki-vpn/roles/vpn \
        allow_any_name=true \
        server_flag=false \
        client_flag=true \
        max_ttl="43800h"

# Issue a personal certificate and save it to AzureClient.cer and AzureClient.key
vault write pki-vpn/issue/vpn common_name="AzureClient" display_name="Test VPN Certificate" ttl="26280h"

为确保证书格式正确,我运行了 certutil.exe -MergePFX AzureClient.cer AzureClient.pfxAzure docs 准确地引用了证书需要去的地方,以及它们的预期名称。我已经确认它们存在于那个位置。我还将中间根上传到 Azure VPN 网关点到站点配置页面,只将原始证书数据放在字段中,不复制页眉或页脚。

我对此进行了多次测试,以确保正确生成和正确上传证书。当我尝试登录我的 VPN 网关时,我收到错误 1244:

VPN Gateway Error

我找不到任何关于此错误试图告诉我的内容的参考,或者甚至抛出它的原因。因为我使用的是 Azure 证书 身份验证方法,所以我假设没有额外的身份验证步骤,因为甚至没有向证书添加身份验证的方法。我确实尝试在证书上添加密码,但小的 Azure UI 不会提示输入任何内容。我还验证了 Windows 10 上的 VPN 配置是“证书”而不是“用户名和密码”,因此它正在寻找正确的证书。

它在寻找什么身份验证方法,为什么会抛出错误?

0 个答案:

没有答案