<p>I have installed ISTIO with the below configuration</p>
<pre><code>cat &lt;&lt; EOF | kubectl apply -f -
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
  namespace: istio-system
  name: istio-control-plane
spec:
  # Use the default profile as the base
  # More details at: https://istio.io/docs/setup/additional-setup/config-profiles/
  profile: default
  # Enable the addons that we will want to use
  addonComponents:
    grafana:
      enabled: true
    prometheus:
      enabled: true
    tracing:
      enabled: true
    kiali:
      enabled: true
  values:
    global:
      # Ensure that the Istio pods are only scheduled to run on Linux nodes
      defaultNodeSelector:
        beta.kubernetes.io/os: linux
    kiali:
      dashboard:
        auth:
          strategy: anonymous
  components:
    egressGateways:
    - name: istio-egressgateway
      enabled: true
  meshConfig:
    accessLogFile: /dev/stdout
    outboundTrafficPolicy:
      mode: REGISTRY_ONLY
EOF
</code></pre>
<p>and have configured the Egress Gateway, Destination Rule &amp; Virtual Service as shown below</p>
<pre><code>cat &lt;&lt; EOF | kubectl apply -f -
apiVersion: v1
kind: Namespace
metadata:
  name: akv2k8s-test
  labels:
    istio-injection: enabled
    azure-key-vault-env-injection: enabled
---
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
  name: edition-cnn-com
  namespace: akv2k8s-test
spec:
  hosts:
  - edition.cnn.com
  ports:
  - number: 443
    name: https-port
    protocol: HTTPS
  resolution: DNS
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: edition-cnn-com
  namespace: akv2k8s-test
spec:
  hosts:
  - edition.cnn.com
  tls:
  - match:
    - port: 443
      sniHosts:
      - edition.cnn.com
    route:
    - destination:
        host: edition.cnn.com
        port:
          number: 443
      weight: 100
EOF
</code></pre>
<p>While trying to access it throws an error</p>
<pre><code>kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.7/samples/sleep/sleep.yaml -n akv2k8s-test
export SOURCE_POD=$(kubectl get pod -l app=sleep -n akv2k8s-test -o jsonpath={.items..metadata.name})
kubectl exec &quot;$SOURCE_POD&quot; -n akv2k8s-test -c sleep -- curl -sL -o /dev/null -D - https://edition.cnn.com/politics
kubectl logs -l istio=egressgateway -c istio-proxy -n istio-system | tail
</code></pre>
<p><a href="https://i.stack.imgur.com/tBPsQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tBPsQ.png" alt="enter image description here" /></a></p>
<p>How do I fix this?</p>
<p><strong>Update</strong>: I have also tried the below, but still the same result</p>
<pre><code>kubectl apply -f - &lt;&lt;EOF
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
  name: svc-entry
  namespace: akv2k8s-test
spec:
  hosts:
  - google.com
  ports:
  - number: 443
    name: https
    protocol: HTTPS
  location: MESH_EXTERNAL
  resolution: DNS
EOF

kubectl apply -f - &lt;&lt;EOF
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: ext-res-dr
  namespace: akv2k8s-test
spec:
  host: google.com
EOF

kubectl apply -f - &lt;&lt;EOF
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: ext-res-gw
  namespace: akv2k8s-test
spec:
  selector:
    istio: egressgateway
  servers:
  - port:
      number: 443
      name: tls
      protocol: TLS
    hosts:
    - google.com
    tls:
      mode: PASSTHROUGH
EOF

kubectl apply -f - &lt;&lt;EOF
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: ext-res-vs
  namespace: akv2k8s-test
spec:
  hosts:
  - google.com
  gateways:
  - mesh
  - ext-res-gw
  tls:
  - match:
    - gateways:
      - mesh
      port: 443
      sniHosts:
      - google.com
    route:
    - destination:
        host: istio-egressgateway.istio-system.svc.cluster.local
        subset: google
        port:
          number: 443
  - match:
    - gateways:
      - ext-res-gw
      port: 443
      sniHosts:
      - google.com
    route:
    - destination:
        host: google.com
        port:
          number: 443
      weight: 100
EOF
</code></pre>

One Developer
<p>I'm not sure what's wrong with first example as there are no all dependencies, about the update there was an issue with your DestinationRule</p>
<p>It should be</p>
<pre><code>apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: ext-res-dr
  namespace: akv2k8s-test
spec:
  host: istio-egressgateway.istio-system.svc.cluster.local
  subsets:
  - name: google
</code></pre>
<p>Instead of</p>
<pre><code>kubectl apply -f - &lt;&lt;EOF
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: ext-res-dr
  namespace: akv2k8s-test
spec:
  host: google.com
</code></pre>
<p>and hosts/sniHosts</p>
<p>It should be</p>
<pre><code>www.google.com
</code></pre>
<p>Instead of</p>
<pre><code>google.com
</code></pre>
<hr />
<p>There is working example for <code>https://www.google.com</code>.</p>
<pre><code>apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
  name: svc-entry
  namespace: akv2k8s-test
spec:
  hosts:
  - www.google.com
  ports:
  - number: 443
    name: https
    protocol: HTTPS
  location: MESH_EXTERNAL
  resolution: DNS

---

apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: ext-res-dr
  namespace: akv2k8s-test
spec:
  host: istio-egressgateway.istio-system.svc.cluster.local
  subsets:
  - name: google
---

apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: ext-res-gw
  namespace: akv2k8s-test
spec:
  selector:
    istio: egressgateway
  servers:
  - port:
      number: 443
      name: tls
      protocol: TLS
    hosts:
    - www.google.com
    tls:
      mode: PASSTHROUGH

---

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: ext-res-vs
  namespace: akv2k8s-test
spec:
  hosts:
  - www.google.com
  gateways:
  - mesh
  - ext-res-gw
  tls:
  - match:
    - gateways:
      - mesh
      port: 443
      sniHosts:
      - www.google.com
    route:
    - destination:
        host: istio-egressgateway.istio-system.svc.cluster.local
        subset: google
        port:
          number: 443
  - match:
    - gateways:
      - ext-res-gw
      port: 443
      sniHosts:
      - www.google.com
    route:
    - destination:
        host: www.google.com
        port:
          number: 443
      weight: 100
</code></pre>
<p>And there is registry mode, curl and egress logs.</p>
<pre><code>kubectl get istiooperator istio-control-plane -n istio-system -o jsonpath='{.spec.meshConfig.outboundTrafficPolicy.mode}'
REGISTRY_ONLY

kubectl exec &quot;$SOURCE_POD&quot; -n akv2k8s-test -c sleep -- curl -sL -o /dev/null -D - https://www.google.com
HTTP/2 200

kubectl logs -l istio=egressgateway -c istio-proxy -n istio-system | tail
[2020-10-27T14:16:37.735Z] &quot;- - -&quot; 0 - &quot;-&quot; &quot;-&quot; 844 17705 45 - &quot;-&quot; &quot;-&quot; &quot;-&quot; &quot;-&quot; &quot;xxx.xxx.xxx.xxx:443&quot; outbound|443||www.google.com xx.xx.xx.xx:59814 xx.xx.xx.xx:8443 1xx.xx.xx.xx:33112 www.google.com -
[2020-10-27T14:18:45.896Z] &quot;- - -&quot; 0 - &quot;-&quot; &quot;-&quot; 883 17647 38 - &quot;-&quot; &quot;-&quot; &quot;-&quot; &quot;-&quot; &quot;xxx.xxx.xxx.xxx:443&quot; outbound|443||www.google.com xx.xx.xx.xx:56834 xx.xx.xx.xx:8443 xx.xx.xx.xx:33964 www.google.com -
</code></pre>
<p>Please refer to this <a href="https://istio.io/latest/docs/tasks/traffic-management/egress/egress-gateway/#egress-gateway-for-https-traffic" rel="nofollow noreferrer">documentation</a>.</p>
