narate opened a new issue, #12501:
URL: https://github.com/apache/apisix/issues/12501

   ### Current Behavior
   
   When create routes with admin ui to https upstream then call an api via 
apisix then apisix response Internal server error.
   
   <img width="465" height="194" alt="Image" 
src="https://github.com/user-attachments/assets/1083437d-73d5-454f-b346-a317c45b5602";
 />
   
   ### 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
   
   1. Run APISIX via Docker
   2. Access to Admin UI
   3. Create Routes with `Name: Get,  URI: /get, upstream: nodes: 
httpbun.com:443, scheme: https, pass_host: node` then Add
   4. Access API via `curl http://127.0.0.1:9080/get` will got an Internal 
Server Error
   
   **Investigate**
   1.  Inspect the payload of route creating
   
   <img width="735" height="340" alt="Image" 
src="https://github.com/user-attachments/assets/1c81c837-d3cd-4267-9cd0-acb3d54db156";
 />
   
   the upstream tls verify set to false
   
   **Work around fix**
   
   > Remove upstream tls verify
   
   Required:
   - curl
   - jq
   
   ```
   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`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to