apache / apisix

The Cloud-Native API Gateway
https://apisix.apache.org/blog/
Apache License 2.0
14.55k stars 2.52k forks source link

help request: Stream Proxy with TLS #11736

Closed JorgeAraujo123 closed 1 week ago

JorgeAraujo123 commented 2 weeks ago

Description

I'm using apisix on K8S and i'm trying to do stream proxy via TCP with TLS I've done the following (via helm):

proxy_mode: http&stream
stream_proxy:
  tcp: 
    - addr: 636
      tls: true
service:
  stream:
    enabled: true
    tcp:
      - addr: 636
        tls: true

And create the tls and the route:

---
apiVersion: apisix.apache.org/v2
kind: ApisixTls
metadata:
  name: vldap-tls
spec:
  hosts:
    - vldap.test.com
  secret:
    name: secret
    namespace: apisix
---
apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
  name: vldap
spec:
  stream:
  - name: vldap
    protocol: TCP
    match:
      ingressPort: 636
      host: vldap.test.com
    backend:
      serviceName: vldap
      servicePort: 636

If i do the request direct to the service i get the response, but via apisix i don't:

ldap_err2string
ldap_result: Can't contact LDAP server (-1)
ldap_do_free_request: asked to free lr 0x55f921e8f3e0 msgid 1 refcnt 0
ldap_free_connection 1 1
ldap_free_connection: actually freed

Am i missing something?

Environment

JorgeAraujo123 commented 1 week ago

Problem solved It was the enable_tcp_pp_to_upstream, i needed to set it to false