# HostSNIRegexp not working for IngressRouteTCP

**URL:** <https://community.traefik.io/t/hostsniregexp-not-working-for-ingressroutetcp/16867>\
**Category:** Traefik v2\
**Tags:** kubernetes-crd\
**Created:** [December 19, 2022, 2:32pm UTC](https://community.traefik.io/t/hostsniregexp-not-working-for-ingressroutetcp/16867 "2022-12-19T14:32:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jomuench](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/jomuench/32/6380_2.png) [@jomuench](https://community.traefik.io/u/jomuench)\
**Post date:** [December 19, 2022, 2:32pm UTC](https://community.traefik.io/t/hostsniregexp-not-working-for-ingressroutetcp/16867/1 "2022-12-19T14:32:59Z")

</div>

have an ingressroutetcp installed. If using a fixed string for HostSNI, the connection works well:

```auto
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRouteTCP
metadata:
  name: kafka-route-0
  namespace: infra-components
spec:
  entryPoints:
    - kafka-0
  routes:
    - match: HostSNI(`tnap-dev-01.tnaplab.telekom.de`)
      services:
        - name: onap-strimzi-kafka-0
          namespace: onap
          port: 9094
  tls:
    passthrough: true

```

However, since I want to make this variable using a wildcard certificate, I changed the match expression to:

```auto
HostSNIRegexp(`{subdomain:[[:ascii:]]+.tnaplab.telekom.de}`)

```

traefik container logs:

```auto
time="2022-12-19T11:29:36Z" level=error msg="unknown rule HostSNIRegexp(`{subdomain:[[:ascii:]]+.tnaplab.telekom.de}`)" entryPointName=kafka-0 routerName=infra-components-kafka-route-0-bf0bad0556332126f919@kubernetescrd

```

I tried some more Regexp's, also tried HostRegexp - all resulting in errors.

/ $ traefik version  
Version: 2.6.3  
Codename: rocamadour  
Go version: go1.17.8  
Built: 2022-03-29T13:09:27Z  
OS/Arch: linux/amd64

kubernetes version: 1.22.5

any advice appreciated!

---

<div class="post-metadata">

**Author:** ![tommoulard](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/tommoulard/32/2997_2.png) [@tommoulard](https://community.traefik.io/u/tommoulard)\
**Post date:** [December 19, 2022, 4:15pm UTC](https://community.traefik.io/t/hostsniregexp-not-working-for-ingressroutetcp/16867/2 "2022-12-19T16:15:29Z")

</div>

Hello @jomuench,

The `HostSNIRegexp` matcher was not available in Traefik `v2.6.3`, you should update the image version.

---

<div class="post-metadata">

**Author:** ![jomuench](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/jomuench/32/6380_2.png) [@jomuench](https://community.traefik.io/u/jomuench)\
**Post date:** [December 20, 2022, 8:24am UTC](https://community.traefik.io/t/hostsniregexp-not-working-for-ingressroutetcp/16867/3 "2022-12-20T08:24:45Z")

</div>

Dear Tommoulard,  
thanks, also now I found in the release notes that `HostSNIRegexp` has been introduced with v2.7.0 - sorry I didn't catch it myself earlier.

BR -  
Michi
