[Bug]: API Portal sign-in code exchange and JWKS fetch ignore [api_portal.http_client.tls]

オープン
#4,435 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript, nodejs

調査の方向性

Start with the passport-oauth2 strategy setup in portals/api-portal/src/middlewares/passportConfig.js (around line 104) and getJwksResolver in src/utils/jwksResolver.js (around line 33), then read buildOutboundAgents in src/config/httpClientOptions.js to see how the shared agent is built. Done means the code exchange and the JWKS fetch use that same agent, so a narrowed http_client.tls setting applies to them as it does to token refresh.

索引モデルが issue の本文から書いたものです。

説明

Area/DeveloperPortal Aspect/Configuration Severity/Minor Type/Bug
Please select the area the issue is related to

DeveloperPortal

Please select the aspect the issue is related to

Aspect/Configuration (Config files, settings, env vars, defaults)

Description

[api_portal.http_client.tls] sets the TLS versions, cipher suites and key-exchange groups for the connections the API Portal opens to other services. In idp authentication mode, two connections to the identity provider don't use it:

  1. The sign-in authorization code exchange at auth.idp.token_url. The passport-oauth2 strategy (passportConfig.js#L104) is created without an agent, so it uses Node's global HTTPS agent.
  2. Fetching signing keys from auth.idp.jwks_url / jwks_url_template. getJwksResolver (jwksResolver.js#L33) calls createRemoteJWKSet(new URL(jwksURL)) without a custom fetch, so it uses the runtime's default fetch.

All other outbound calls take their agent from buildOutboundAgents (httpClientOptions.js): Platform API local login, token refresh (tokenUtil), key managers, billing, the try-it proxy and webhook delivery.

Because these two connections run on runtime defaults:

  • Narrowing minimum_protocol_version, maximum_protocol_version, ciphers or ecdh_curves (for example, for compliance) has no effect on them.
  • They offer X25519MLKEM768 first: the runtime default group list on the node:24-alpine image (OpenSSL 3.5). The configured outbound default is the classical X25519,P-256, so the two connections don't follow it.
  • Token refresh goes to the same token_url and does use http_client.tls, so the identity provider sees two different TLS profiles from one portal.

This came up while documenting the portal's TLS settings (wso2/docs-api-platform#855, which notes the limitation). It was found by reading the code on main (5be6e920a). I haven't captured it end to end.

Expected

Both connections use the shared outbound agent's TLS options, as the other outbound calls do. For example, strategy._oauth2.setAgent(httpsAgent) for passport-oauth2, and a [customFetch] on createRemoteJWKSet that goes through the same agent.

Steps to Reproduce
  1. Run the portal with auth.mode = "idp" against an identity provider served over HTTPS.

  2. Add to configs/config.toml and restart:

    [api_portal.http_client.tls]
    maximum_protocol_version = "TLS1_2"
    
  3. Sign in through the browser and record the portal-to-IdP TLS handshakes, for example with a packet capture on the identity provider's host or its TLS access log.

  4. Observed (expected from the code): the code exchange and the JWKS fetch negotiate TLS 1.3 and offer X25519MLKEM768, while a later token refresh is capped at TLS 1.2.

Severity Level of the Issue

Severity/Minor (Non-critical functionality. Can be fixed in future releases)

Environment Details (with versions)

main at 5be6e920a; node:24-alpine image (Node 24, OpenSSL 3.5).

主要言語
Go
スター
85
フォーク
142
平均マージ
1日 7時間
マージ済み PR(30日)
255

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

wso2/api-platform のほかの issue

wso2/api-platform の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。