You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

WSO2 IS X509认证器防火墙(仅开80/443端口)配置方案咨询

解决方案:WSO2 IS X509认证器在受限防火墙环境下的端口配置问题

问题根源在于WSO2 IS内部生成回调URL时默认使用了X509自定义传输的8443端口,而非外部代理的443端口,同时反向代理配置未覆盖认证流程的关键端点。按以下步骤修改配置即可解决:

1. 配置WSO2 IS识别外部代理地址与端口

在deployment.toml中添加/修改以下配置,让IS生成外部可访问的URL时使用443端口:

[server]
hostname = "mydomain"
https_port = 443
proxy_port = 443

[transport.https.properties]
proxyPort = 443

2. 强制X509认证器使用正确的回调URL

更新deployment.toml中的X509认证器参数,显式指定外部可访问的回调端点:

[authentication.authenticator.x509_certificate.parameters]
AuthenticationEndpoint="https://mydomain/x509-certificate-servlet"
CallbackUrl="https://mydomain/commonauth"

3. 完善Nginx反向代理配置

确保Nginx同时代理X509 servlet和commonauth端点,并传递正确的请求头部:

server {
    listen 443 ssl;
    server_name mydomain;

    ssl_certificate /path/to/your/cert.pem;
    ssl_certificate_key /path/to/your/key.pem;

    location /x509-certificate-servlet {
        proxy_pass https://<is_server>:8443;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    location /commonauth {
        proxy_pass https://<is_server>:9443; # 替换为你的IS主HTTPS端口
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

注意:commonauth是IS主认证流程的核心端点,对应IS默认的9443端口,若你的IS主HTTPS端口已修改,需同步替换此处端口。

4. 确认X509自定义传输的内部绑定配置

确保custom_transport.x509.properties仅允许内部访问,无需对外暴露:

[custom_transport.x509.properties]
port="8443"
bind_address="0.0.0.0" # 仅需允许Nginx所在服务器访问即可

完成以上配置后,重启WSO2 IS和Nginx。此时X509认证流程将全程使用443端口:

  • 用户访问https://mydomain/x509-certificate-servlet(经Nginx代理到IS的8443端口)
  • 认证成功后重定向到https://mydomain/commonauth(经Nginx代理到IS的主HTTPS端口)
  • 最终完成认证,不会再出现被防火墙阻断的8443端口重定向。

内容的提问来源于stack exchange,提问作者Alexey Dolgopolov

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.17 18:33:24