Current Behavior
When create routes with admin ui to https upstream then call an api via apisix then apisix response Internal server error.
Expected Behavior
Got response from upstream server
Error Logs
2025/08/07 11:38:48 [error] 50#50: *83823 lua entry thread aborted: runtime error: /usr/local/openresty/lualib/ngx/ssl.lua:448: attempt to get length of local 'pem' (a nil value)
stack traceback:
coroutine 0:
/usr/local/openresty/lualib/ngx/ssl.lua: in function 'parse_pem_cert'
/usr/local/apisix/apisix/ssl.lua:216: in function 'create_obj_fun'
/usr/local/apisix/apisix/core/lrucache.lua:95: in function 'cert_cache'
/usr/local/apisix/apisix/ssl.lua:222: in function 'fetch_cert'
/usr/local/apisix/apisix/upstream.lua:392: in function 'set_upstream'
/usr/local/apisix/apisix/init.lua:562: in function 'handle_upstream'
/usr/local/apisix/apisix/init.lua:748: in function 'http_access_phase'
access_by_lua(nginx.conf:436):2: in main chunk, client: 192.168.65.1, server: _, request: "GET /get HTTP/1.1", host: "127.0.0.1"
Steps to Reproduce
- Run APISIX via Docker
- Access to Admin UI
- Create Routes with
Name: Get, URI: /get, upstream: nodes: httpbun.com:443, scheme: https, pass_host: node then Add
- Access API via
curl http://127.0.0.1:9080/get will get an Internal Server Error
Investigate
- Inspect the payload of route creating
the upstream tls verify set to false
Work around fix
Remove upstream tls verify
Required:
export ADMIN_KEY=your_admin_key_here
export ROUTE_ID=route_id
curl -s -H "X-API-KEY: $ADMIN_KEY" http://127.0.0.1:9180/apisix/admin/routes/$ROUTE_ID | jq '.value | del(.upstream.tls, .create_time)' > get.patch.json
curl -s -H "X-API-KEY: $ADMIN_KEY" http://127.0.0.1:9180/apisix/admin/routes/$ROUTE_ID -X PUT -d @get.patch.json
Now we can call an API via APISIX with expected response
Environment
- APISIX version
3.13.0
- Operating system : Docker image
apache/apisix:3.13.0-ubuntu, Linux e58f105a038a 6.10.14-linuxkit #1 SMP Sat May 17 08:28:57 UTC 2025 aarch64 aarch64 aarch64 GNU/Linux
Current Behavior
When create routes with admin ui to https upstream then call an api via apisix then apisix response Internal server error.
Expected Behavior
Got response from upstream server
Error Logs
Steps to Reproduce
Name: Get, URI: /get, upstream: nodes: httpbun.com:443, scheme: https, pass_host: nodethen Addcurl http://127.0.0.1:9080/getwill get an Internal Server ErrorInvestigate
the upstream tls verify set to false
Work around fix
Required:
Now we can call an API via APISIX with expected response
Environment
3.13.0apache/apisix:3.13.0-ubuntu, Linux e58f105a038a 6.10.14-linuxkit #1 SMP Sat May 17 08:28:57 UTC 2025 aarch64 aarch64 aarch64 GNU/Linux