<p>Istio does not route to external HTTPs service via TLS origination.</p>

<p>I have a pod containing two containers:
- Application 
- ISTIO Proxy</p>

<p>Application makes a call to external third party API which resides on <a href="https://someurl.somedomain.com/v1/some-service" rel="nofollow noreferrer">https://someurl.somedomain.com/v1/some-service</a></p>

<p>Application sends HTTP requests to this service by calling <a href="http://someurl.somedomain.com/v1/some-service" rel="nofollow noreferrer">http://someurl.somedomain.com/v1/some-service</a> - notice that it's HTTP and not HTTPs.</p>

<p>I then configured the following in ISTIO:</p>

<ul>
<li>Virtual service to route HTTP traffic to port 443:</li>
</ul>

<pre><code>---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: someservice-vs
spec:
  hosts:
  - someurl.somedomain.com
  http:
  - match:
    - port: 80    
    route:
    - destination:
        host: someurl.somedomain.com
        port:
          number: 443      
    timeout: 40s
    retries:
      attempts: 10
      perTryTimeout: 4s      
      retryOn: gateway-error,connect-failure,refused-stream,retriable-4xx,5xx 
</code></pre>

<ul>
<li>Service Entry that allows the traffic out. As you can see, we specify that service is external to the mesh and we opened 443 and 80 both of which use HTTP, but 443 is configured for TLS origination.</li>
</ul>

<pre><code>apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
  name: someservice-se
spec:
  hosts:
  - someurl.somedomain.com
  location: MESH_EXTERNAL
  ports:
  - number: 443
    name: http-port-for-tls-origination
    protocol: HTTP
  - number: 80
    name: http-port
    protocol: HTTP
  resolution: DNS

</code></pre>

<p>Finally, I have a destination rule that applies simple TLS to the outgoing traffic:</p>

<pre><code>
---
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: someservice-destinationrule
spec:
  host: someurl.somedomain.com
  trafficPolicy:
    loadBalancer:
      simple: ROUND_ROBIN
    portLevelSettings:
    - port:
        number: 443
      tls:
        mode: SIMPLE # initiates HTTPS when accessing someurl.somedomain.com 

</code></pre>

<p>For some reason this does not work and I get 404 when calling the service from my application container, which indicates that traffic isn't being encrypted via TLS.</p>

<p>The reason why I use TLS origination is because I need to apply re-tries in my virtual service and I can only do this with HTTP routes as otherwise ISTIO cannot see request and work with it. </p>

<p>Been scratching my head for two days and need some help please :-)</p>

vikp
<p>Got to the bottom of this. ISTIO documentation was correct - TLS origination and retries work as expected. </p>

<p>The issue was caused by the perTryTimeout value which was too low. Requests were not completing in allocated time, so the gateway was timing out. It caught us out because the external service's performance has degraded recently and we didn't think to check it. </p>
